lib/katapult/navigation.rb in katapult-0.2.0 vs lib/katapult/navigation.rb in katapult-0.3.0

- old
+ new

@@ -1,18 +1,23 @@ -# Models a navigation. +# Models the main menu require 'katapult/element' require 'generators/katapult/navigation/navigation_generator' module Katapult class Navigation < Element - def wuis - application_model.wuis + def web_uis + application_model.web_uis end - def section_name(wui) - wui.model_name(:symbols) + def links + web_uis.each_with_object({}) do |web_ui, map| + next unless web_ui.find_action(:index).present? + + label = web_ui.model_name :humans + map[label] = web_ui.path(:index) + end end def render Generators::NavigationGenerator.new(self).invoke_all end