Class: ApplicationPresenter

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
app/presenters/application_presenter.rb

Overview

Direct Known Subclasses

TemplatePresenter

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.model(model_alias) ⇒ Object



24
25
26
# File 'app/presenters/application_presenter.rb', line 24

def model(model_alias)
  alias_method(model_alias, :model)
end

Instance Method Details

#hObject

Provide access to view/helpers



19
20
21
# File 'app/presenters/application_presenter.rb', line 19

def h
  @h ||= ActionView::Base.new
end

#modelObject

Returns reference to the object we’re decorating



10
11
12
# File 'app/presenters/application_presenter.rb', line 10

def model
  __getobj__
end

#routeObject



14
15
16
# File 'app/presenters/application_presenter.rb', line 14

def route
  Rails.application.routes.url_helpers
end