Class: Administrate::Page::Base
- Inherits:
-
Object
- Object
- Administrate::Page::Base
- Defined in:
- lib/administrate/page/base.rb
Direct Known Subclasses
Instance Method Summary collapse
- #collection_includes ⇒ Object
-
#initialize(dashboard, options = {}) ⇒ Base
constructor
A new instance of Base.
- #item_associations ⇒ Object
- #item_includes ⇒ Object
- #resource_name ⇒ Object
- #resource_path ⇒ Object
Constructor Details
#initialize(dashboard, options = {}) ⇒ Base
Returns a new instance of Base.
4 5 6 7 |
# File 'lib/administrate/page/base.rb', line 4 def initialize(dashboard, = {}) @dashboard = dashboard @options = end |
Instance Method Details
#collection_includes ⇒ Object
18 19 20 |
# File 'lib/administrate/page/base.rb', line 18 def collection_includes dashboard.try(:collection_includes) || [] end |
#item_associations ⇒ Object
26 27 28 |
# File 'lib/administrate/page/base.rb', line 26 def item_associations dashboard.try(:item_associations) || [] end |
#item_includes ⇒ Object
22 23 24 |
# File 'lib/administrate/page/base.rb', line 22 def item_includes dashboard.try(:item_includes) || [] end |
#resource_name ⇒ Object
9 10 11 12 |
# File 'lib/administrate/page/base.rb', line 9 def resource_name @resource_name ||= dashboard.class.to_s.scan(/(.+)Dashboard/).first.first.underscore end |
#resource_path ⇒ Object
14 15 16 |
# File 'lib/administrate/page/base.rb', line 14 def resource_path @resource_path ||= resource_name.tr("/", "_") end |