Class: Administrate::Page::Base
- Inherits:
-
Object
- Object
- Administrate::Page::Base
- Defined in:
- lib/administrate/page/base.rb
Direct Known Subclasses
Instance Method Summary collapse
- #association_includes ⇒ Object
-
#initialize(dashboard, options = {}) ⇒ Base
constructor
A new instance of Base.
- #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
#association_includes ⇒ Object
18 19 20 |
# File 'lib/administrate/page/base.rb', line 18 def association_includes dashboard.try(:association_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.gsub("/", "_") end |