Class: Administrate::Page::Show
- Defined in:
- lib/administrate/page/show.rb
Instance Attribute Summary collapse
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
- #attributes ⇒ Object
-
#initialize(dashboard, resource) ⇒ Show
constructor
A new instance of Show.
- #page_title ⇒ Object
Methods inherited from Base
#collection_includes, #item_associations, #item_includes, #resource_name, #resource_path
Constructor Details
#initialize(dashboard, resource) ⇒ Show
Returns a new instance of Show.
6 7 8 9 |
# File 'lib/administrate/page/show.rb', line 6 def initialize(dashboard, resource) super(dashboard) @resource = resource end |
Instance Attribute Details
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
11 12 13 |
# File 'lib/administrate/page/show.rb', line 11 def resource @resource end |
Instance Method Details
#attributes ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/administrate/page/show.rb', line 17 def attributes attributes = dashboard.show_page_attributes if attributes.is_a? Array attributes = {"" => attributes} end attributes.transform_values do |attrs| attrs.map do |attr_name| attribute_field(dashboard, resource, attr_name, :show) end end end |
#page_title ⇒ Object
13 14 15 |
# File 'lib/administrate/page/show.rb', line 13 def page_title dashboard.display_resource(resource) end |