Class: Decidim::Proposals::ProposalPresenter
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Decidim::Proposals::ProposalPresenter
- Includes:
- ActionView::Helpers::UrlHelper
- Defined in:
- app/presenters/decidim/proposals/proposal_presenter.rb
Overview
Decorator for proposals
Instance Method Summary collapse
Instance Method Details
#author ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'app/presenters/decidim/proposals/proposal_presenter.rb', line 12 def @author ||= if official? Decidim::Proposals::OfficialAuthorPresenter.new elsif user_group Decidim::UserGroupPresenter.new(user_group) else Decidim::UserPresenter.new(super) end end |
#display_mention ⇒ Object
27 28 29 |
# File 'app/presenters/decidim/proposals/proposal_presenter.rb', line 27 def display_mention link_to title, proposal_path end |
#proposal_path ⇒ Object
22 23 24 25 |
# File 'app/presenters/decidim/proposals/proposal_presenter.rb', line 22 def proposal_path proposal = __getobj__ Decidim::ResourceLocatorPresenter.new(proposal).path end |