Class: Integral::BaseDecorator
- Inherits:
-
Draper::Decorator
- Object
- Draper::Decorator
- Integral::BaseDecorator
- Defined in:
- app/decorators/integral/base_decorator.rb
Overview
Base decorator for Integral view-level logic
Direct Known Subclasses
BlockEditor::BlockListDecorator, CategoryDecorator, ListDecorator, PageDecorator, PostDecorator, Storage::FileDecorator, UserDecorator
Instance Method Summary collapse
-
#activity_url(activity_id) ⇒ String
URL to backend activity.
-
#backend_url ⇒ String
URL to backend page.
-
#edit_backend_url ⇒ String
URL to backend edit page.
- #render_active_block_list ⇒ Object
- #to_backend_card ⇒ Object
Instance Method Details
#activity_url(activity_id) ⇒ String
Returns URL to backend activity.
7 8 9 |
# File 'app/decorators/integral/base_decorator.rb', line 7 def activity_url(activity_id) engine_url_helpers.send("activity_backend_#{object.class.model_name.singular_route_key}_url", object.id, activity_id) end |
#backend_url ⇒ String
Returns URL to backend page.
17 18 19 |
# File 'app/decorators/integral/base_decorator.rb', line 17 def backend_url engine_url_helpers.send("backend_#{object.class.model_name.singular_route_key}_url", object.id) end |
#edit_backend_url ⇒ String
Returns URL to backend edit page.
12 13 14 |
# File 'app/decorators/integral/base_decorator.rb', line 12 def edit_backend_url engine_url_helpers.send("edit_backend_#{object.class.model_name.singular_route_key}_url", object.id) end |
#render_active_block_list ⇒ Object
36 37 38 |
# File 'app/decorators/integral/base_decorator.rb', line 36 def render_active_block_list helpers.render_block_list(active_block_list) end |
#to_backend_card ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/decorators/integral/base_decorator.rb', line 21 def to_backend_card attributes = [ { key: I18n.t('integral.records.attributes.id'), value: id }, { key: I18n.t('integral.records.attributes.updated_at'), value: I18n.l(updated_at) }, { key: I18n.t('integral.records.attributes.created_at'), value: I18n.l(created_at) } ] { image: nil, description: nil, url: backend_url, attributes: attributes } end |