Class: ActiveAdmin::Resource
- Inherits:
-
Object
- Object
- ActiveAdmin::Resource
- Defined in:
- lib/active_admin/subnav/extensions/resource.rb,
lib/active_admin/subnav/extensions/resource_menu.rb
Defined Under Namespace
Modules: Menu
Instance Method Summary collapse
- #belongs_to(target, options = {}) ⇒ Object
- #has_nested_resources? ⇒ Boolean
- #nested_resources=(value) ⇒ Object
- #show_sub_menu?(action) ⇒ Boolean
Instance Method Details
#belongs_to(target, options = {}) ⇒ Object
3 4 5 6 7 |
# File 'lib/active_admin/subnav/extensions/resource.rb', line 3 def belongs_to(target, = {}) @belongs_to = Resource::BelongsTo.new(self, target, ) self. = target controller.send :belongs_to, target, .dup end |
#has_nested_resources? ⇒ Boolean
13 14 15 |
# File 'lib/active_admin/subnav/extensions/resource.rb', line 13 def has_nested_resources? @nested_resources end |
#nested_resources=(value) ⇒ Object
9 10 11 |
# File 'lib/active_admin/subnav/extensions/resource.rb', line 9 def nested_resources=(value) @nested_resources = value end |
#show_sub_menu?(action) ⇒ Boolean
17 18 19 |
# File 'lib/active_admin/subnav/extensions/resource.rb', line 17 def (action) || (has_nested_resources? && ["show", "edit"].include?(action)) end |