Skip to content

Commit

Permalink
Explorer show: use controller_name instead of request.parameters[:con…
Browse files Browse the repository at this point in the history
…troller]
  • Loading branch information
martinpovolny committed May 19, 2017
1 parent 2953682 commit 6647f7b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/controllers/mixins/explorer_show.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand All @@ -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
Expand Down

0 comments on commit 6647f7b

Please sign in to comment.