summaryrefslogtreecommitdiff
path: root/app/controllers/intruders_controller.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-02-16 11:10:02 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-02-16 11:10:02 +0100
commit5d8ce5f4775ac8bc5f523964e6e36f63ff3c4683 (patch)
tree49ed889b1d10cda98c475f3453abff1b97afb4e7 /app/controllers/intruders_controller.rb
parentc9066760fd1f5f2f892ce2be5cf2a83bb5210246 (diff)
parent55784bcffc0678ce6102c0b81447434a8030ebd2 (diff)
Merge branch 'develop'5.1-beta5
Diffstat (limited to 'app/controllers/intruders_controller.rb')
-rw-r--r--app/controllers/intruders_controller.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/controllers/intruders_controller.rb b/app/controllers/intruders_controller.rb
index eb34f2b..147e06d 100644
--- a/app/controllers/intruders_controller.rb
+++ b/app/controllers/intruders_controller.rb
@@ -1,18 +1,25 @@
class IntrudersController < ApplicationController
def index
@intruders = Intruder.all
+ spread_breadcrumbs
end
def show
@intruder = Intruder.find(params[:id])
+ if ! params[:whois].blank?
+ @whois = @intruder.whois(params[:whois])
+ end
+ spread_breadcrumbs
end
def new
@intruder = Intruder.new
+ spread_breadcrumbs
end
def create
@intruder = Intruder.new(params[:intruder])
+ spread_breadcrumbs
if @intruder.save
redirect_to @intruder, :notice => t('intruders.controller.successfuly_created')
else
@@ -22,10 +29,12 @@ class IntrudersController < ApplicationController
def edit
@intruder = Intruder.find(params[:id])
+ spread_breadcrumbs
end
def update
@intruder = Intruder.find(params[:id])
+ spread_breadcrumbs
if @intruder.update_attributes(params[:intruder])
redirect_to @intruder, :notice => t('intruders.controller.successfuly_updated')
else
@@ -35,7 +44,16 @@ class IntrudersController < ApplicationController
def destroy
@intruder = Intruder.find(params[:id])
+ spread_breadcrumbs
@intruder.destroy
redirect_to intruders_url, :notice => t('intruders.controller.successfuly_destroyed')
end
+
+ private
+ def spread_breadcrumbs
+ add_breadcrumb t("intruders.index.page_title"), intruders_path
+ if @intruder && !@intruder.new_record?
+ add_breadcrumb @intruder, @intruder
+ end
+ end
end