Module: Decidim::Elections::VotesHelper
- Defined in:
- app/helpers/decidim/elections/votes_helper.rb
Overview
Custom helpers for the voting booth views.
Instance Method Summary collapse
Instance Method Details
#more_information?(answer) ⇒ Boolean
16 17 18 19 20 |
# File 'app/helpers/decidim/elections/votes_helper.rb', line 16 def more_information?(answer) translated_attribute(answer.description).present? || answer.proposals.any? || answer.photos.any? end |
#ordered_answers(question) ⇒ Object
8 9 10 11 12 13 14 |
# File 'app/helpers/decidim/elections/votes_helper.rb', line 8 def ordered_answers(question) if question.random_answers_order question.answers.shuffle else question.answers.sort_by { |answer| [answer.weight, answer.id] } end end |