Method: Alchemy::Admin::NavigationHelper#navigate_module
- Defined in:
- app/helpers/alchemy/admin/navigation_helper.rb
#navigate_module(navigation) ⇒ Object
Used for checking the main navi permissions
To let your module be navigatable by the user you have to provide an Ability for it.
Example:
# module.yml
name: 'my_module'
navigation: {
controller: 'my/admin/posts'
action: 'index'
}
# ability.rb
can :index, :my_admin_posts
38 39 40 41 42 43 |
# File 'app/helpers/alchemy/admin/navigation_helper.rb', line 38 def navigate_module() [ ["action"].to_sym, ["controller"].to_s.gsub(/\A\//, "").tr("/", "_").to_sym ] end |