Permalink
Browse files

More temp vars!

  • Loading branch information...
1 parent 85f316d commit 14bd678c9fdc654c09ff47bb5d9e6fbbfa514899 @gunn committed Oct 2, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 app/helpers/rails_admin/application_helper.rb
@@ -69,9 +69,11 @@ def static_navigation
def navigation nodes_stack, nodes, level=0
nodes.map do |node|
model_param = node.abstract_model.to_param
+ url = url_for(:action => :index, :controller => 'rails_admin/main', :model_name => model_param)
+ level_class = "nav-level-#{level}" if level > 0
%{<li data-model="#{model_param}">
- <a class="pjax nav-level-#{level}" href="#{url_for(:action => :index, :controller => 'rails_admin/main', :model_name => model_param)}">#{node.label_plural}</a>
+ <a class="pjax#{level_class}" href="#{url}">#{node.label_plural}</a>
</li>
#{navigation(nodes_stack, nodes_stack.select{ |n| n.parent.to_s == node.abstract_model.model_name}, level + 1)}
}

0 comments on commit 14bd678

Please sign in to comment.