Module: Decidim::Proposals::ApplicationHelper
- Includes:
- Comments::CommentsHelper, ProposalVotesHelper, PaginateHelper
- Defined in:
- app/helpers/decidim/proposals/application_helper.rb
Overview
Custom helpers, scoped to the proposals engine.
Instance Method Summary collapse
-
#humanize_proposal_state(state) ⇒ Object
Public: The state of a proposal in a way a human can understand.
Methods included from ProposalVotesHelper
#remaining_votes_count_for, #vote_button_classes, #vote_limit_enabled?, #votes_count_classes
Instance Method Details
#humanize_proposal_state(state) ⇒ Object
Public: The state of a proposal in a way a human can understand.
state - The String state of the proposal.
Returns a String.
16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/helpers/decidim/proposals/application_helper.rb', line 16 def humanize_proposal_state(state) value = if state == "accepted" "accepted" elsif state == "rejected" "rejected" else "not_answered" end I18n.t(value, scope: "decidim.proposals.answers") end |