Class: Viewable::ViewPresenter

Inherits:
ViewablePresenter show all
Defined in:
app/presenters/viewable/view_presenter.rb

Direct Known Subclasses

FormPresenter, PagePresenter

Instance Attribute Summary

Attributes inherited from BasePresenter

#context, #model

Instance Method Summary collapse

Methods inherited from ViewablePresenter

#edit_link, #li_sortable_tag

Methods inherited from BasePresenter

#method_missing, #respond_to?

Constructor Details

#initialize(model, context) ⇒ ViewPresenter

Returns a new instance of ViewPresenter.



3
4
5
6
7
# File 'app/presenters/viewable/view_presenter.rb', line 3

def initialize(model, context)
  super
  set_cms_view
  set_meta_tags
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class BasePresenter

Instance Method Details



9
10
11
12
13
14
15
# File 'app/presenters/viewable/view_presenter.rb', line 9

def add_link
  return unless h.cms_edit_mode?

  h.link_to add_path, class: "cms-add cms-add-page", 'data-no-turbolink' => true do
    h.t('cms.add_page')
  end
end