Module: ActiveAdmin::Resource::Menu
- Included in:
- ActiveAdmin::Resource
- Defined in:
- lib/active_admin/resource/menu.rb
Instance Method Summary collapse
-
#include_in_menu? ⇒ Boolean
Should this resource be added to the menu system?.
-
#menu(options = {}) ⇒ Object
Set the menu options.
-
#menu_item_display_if ⇒ Object
Returns a proc for deciding whether to display the menu item or not in the view.
-
#menu_item_name ⇒ Object
Returns the name to be displayed in the menu for this resource.
-
#menu_item_priority ⇒ Object
Returns the items priority for altering the default sort order.
-
#menu_options ⇒ Object
The options to use for the menu.
-
#parent_menu_item_name ⇒ Object
Returns the name to put this resource under in the menu.
Instance Method Details
#include_in_menu? ⇒ Boolean
Should this resource be added to the menu system?
38 39 40 41 |
# File 'lib/active_admin/resource/menu.rb', line 38 def return false if [:display] == false !(belongs_to? && !belongs_to_config.optional?) end |
#menu(options = {}) ⇒ Object
Set the menu options. To not add this resource to the menu, just call #menu(false)
7 8 9 10 |
# File 'lib/active_admin/resource/menu.rb', line 7 def ( = {}) = == false ? { :display => false } : @menu_options = end |
#menu_item_display_if ⇒ Object
Returns a proc for deciding whether to display the menu item or not in the view
33 34 35 |
# File 'lib/active_admin/resource/menu.rb', line 33 def [:if] || proc { true } end |
#menu_item_name ⇒ Object
Returns the name to be displayed in the menu for this resource
23 24 25 |
# File 'lib/active_admin/resource/menu.rb', line 23 def [:label] || plural_resource_name end |
#menu_item_priority ⇒ Object
Returns the items priority for altering the default sort order
28 29 30 |
# File 'lib/active_admin/resource/menu.rb', line 28 def [:priority] || 10 end |
#menu_options ⇒ Object
The options to use for the menu
13 14 15 |
# File 'lib/active_admin/resource/menu.rb', line 13 def @menu_options ||= {} end |
#parent_menu_item_name ⇒ Object
Returns the name to put this resource under in the menu
18 19 20 |
# File 'lib/active_admin/resource/menu.rb', line 18 def [:parent] end |