Class: ApplicationPresenter
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- ApplicationPresenter
- Defined in:
- app/presenters/application_presenter.rb
Overview
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
-
#h ⇒ Object
Provide access to view/helpers.
-
#model ⇒ Object
Returns reference to the object we’re decorating.
- #route ⇒ Object
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
#h ⇒ Object
Provide access to view/helpers
19 20 21 |
# File 'app/presenters/application_presenter.rb', line 19 def h @h ||= ActionView::Base.new end |
#model ⇒ Object
Returns reference to the object we’re decorating
10 11 12 |
# File 'app/presenters/application_presenter.rb', line 10 def model __getobj__ end |
#route ⇒ Object
14 15 16 |
# File 'app/presenters/application_presenter.rb', line 14 def route Rails.application.routes.url_helpers end |