Module: WonderNavigation::Controller
- Defined in:
- lib/wonder_navigation/controller.rb
Class Method Summary collapse
Instance Method Summary collapse
- #set_current_wonder_navigation_menu(current_menu = :default) ⇒ Object
- #set_default_wonder_navigation_page ⇒ Object
- #set_navigation_page(navigation_page) ⇒ Object
- #set_wonder_navigation_object(navigation_object) ⇒ Object
Class Method Details
.included(controller) ⇒ Object
4 5 6 7 |
# File 'lib/wonder_navigation/controller.rb', line 4 def self.included(controller) controller.before_action :set_default_wonder_navigation_page controller.before_action :set_current_wonder_navigation_menu end |
Instance Method Details
#set_current_wonder_navigation_menu(current_menu = :default) ⇒ Object
18 19 20 |
# File 'lib/wonder_navigation/controller.rb', line 18 def ( = :default) = end |
#set_default_wonder_navigation_page ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/wonder_navigation/controller.rb', line 9 def page_action = case action_name.to_sym when :create then :new when :update then :edit else action_name end "#{controller_path.tr('/','_')}_#{page_action}" end |
#set_navigation_page(navigation_page) ⇒ Object
26 27 28 |
# File 'lib/wonder_navigation/controller.rb', line 26 def () = .to_sym end |
#set_wonder_navigation_object(navigation_object) ⇒ Object
22 23 24 |
# File 'lib/wonder_navigation/controller.rb', line 22 def () = end |