Module: BrickLayer::LayoutHelper

Defined in:
app/helpers/brick_layer/layout_helper.rb

Instance Method Summary collapse

Instance Method Details

#nested_routes(routes) ⇒ Object



14
15
16
17
18
# File 'app/helpers/brick_layer/layout_helper.rb', line 14

def nested_routes(routes)
  routes.map do |route, sub_routes|
    render(route) + (:ul, nested_routes(sub_routes), :class => "sub_routes")
  end.join.html_safe
end

#standalone_navigationObject



2
3
4
5
6
7
8
9
10
11
12
# File 'app/helpers/brick_layer/layout_helper.rb', line 2

def standalone_navigation    
  html = ''
  BrickLayer.data_sets_standalones.each do |klass_in_symbol_form|
    klass_to_model_param = klass_in_symbol_form.to_s.underscore.pluralize      
    html +=  :li do
      (:a, klass_in_symbol_form.to_s.underscore.titlecase, :href => data_sets_path(:model => klass_to_model_param))
    end
  end
  
  ( :ul, (:li, "Standalone Content") + html.html_safe )
end