Class: ViewablePresenter
- Inherits:
-
BasePresenter
- Object
- BasePresenter
- ViewablePresenter
- Defined in:
- app/presenters/viewable_presenter.rb
Direct Known Subclasses
Viewable::BlockPresenter, Viewable::ImagePresenter, Viewable::LinkPresenter, Viewable::SelectPresenter, Viewable::TextPresenter, Viewable::ViewPresenter
Instance Attribute Summary
Attributes inherited from BasePresenter
Instance Method Summary collapse
Methods inherited from BasePresenter
#initialize, #method_missing, #respond_to?
Constructor Details
This class inherits a constructor from BasePresenter
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class BasePresenter
Instance Method Details
#edit_link(name = nil) ⇒ Object
2 3 4 5 6 7 8 9 10 |
# File 'app/presenters/viewable_presenter.rb', line 2 def edit_link(name = nil) return unless h.cms_edit_mode? h.link_to edit_path, class: "cms-edit cms-edit-#{dashed_name}", 'data-no-turbolink' => true do h.concat h.content_tag(:span, h.t('cms.edit'), class: "cms-edit-action") h.concat " " h.concat h.content_tag(:span, name, class: "cms-edit-name") end end |
#li_sortable_tag(options = nil) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'app/presenters/viewable_presenter.rb', line 12 def li_sortable_tag( = nil) ||= {} if h.cms_edit_mode? = h.cms_data_js('cms-sortable-id', m.unique_key.id, ) end h.content_tag :li, do yield end end |