From 6647f7bf357c59bfee6effdb3a4fa70dc9ffdb9f Mon Sep 17 00:00:00 2001 From: Martin Povolny Date: Fri, 19 May 2017 15:11:03 +0200 Subject: [PATCH] Explorer show: use controller_name instead of request.parameters[:controller] --- app/controllers/mixins/explorer_show.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/mixins/explorer_show.rb b/app/controllers/mixins/explorer_show.rb index 353fdac8588..12906ca2c39 100644 --- a/app/controllers/mixins/explorer_show.rb +++ b/app/controllers/mixins/explorer_show.rb @@ -47,7 +47,7 @@ def init_show_variables(db = nil) @use_action = true @explorer = true if request.xml_http_request? # Ajax request means in explorer - @db = db || params[:db] || request.parameters[:controller] + @db = db || params[:db] || controller_name session[:db] = @db unless @db.nil? @db = session[:db] unless session[:db].nil? @@ -86,8 +86,8 @@ def guest_applications def item_breadcrumbs(display_name, entity_path) drop_breadcrumb(:name => "#{@record.name} (#{display_name})", - :url => "/#{request.parameters[:controller]}/#{entity_path}/#{@record.id}?page=#{@current_page}") - drop_breadcrumb(:name => @item.name, :url => "/#{request.parameters[:controller]}/show/#{@record.id}?show=#{@item.id}") + :url => "/#{controller_name}/#{entity_path}/#{@record.id}?page=#{@current_page}") + drop_breadcrumb(:name => @item.name, :url => "/#{controller_name}/show/#{@record.id}?show=#{@item.id}") end def patches @@ -147,7 +147,7 @@ def users end def hosts - db = params[:db] || request.parameters[:controller] + db = params[:db] || controller_name db = 'switch' if db == 'infra_networking' return unless init_show_variables(db) @@ -160,7 +160,7 @@ def hosts show_item else drop_breadcrumb(:name => _("%{name} (Hosts)") % {:name => @record.name}, - :url => "/#{request.parameters[:controller]}/hosts/#{@record.id}") + :url => "/#{controller_name}/hosts/#{@record.id}") @listicon = "host" show_details(Host, :association => "hosts") end