Class: Decidim::Votings::Admin::VotingForm
- Inherits:
-
Form
- Object
- Form
- Decidim::Votings::Admin::VotingForm
- Includes:
- TranslatableAttributes
- Defined in:
- app/forms/decidim/votings/admin/voting_form.rb
Overview
This class holds a Form to create/update votings from Decidim’s admin panel.
Instance Method Summary collapse
Instance Method Details
#map_model(model) ⇒ Object
39 40 41 |
# File 'app/forms/decidim/votings/admin/voting_form.rb', line 39 def map_model(model) self.scope_id = model.decidim_scope_id end |
#options_for_voting_type_select ⇒ Object
47 48 49 50 51 52 53 54 |
# File 'app/forms/decidim/votings/admin/voting_form.rb', line 47 def Voting.voting_types.map do |key, value| [ I18n.t("voting_type.#{key}", scope: "decidim.votings.admin.votings.form"), value ] end end |
#scope ⇒ Object
43 44 45 |
# File 'app/forms/decidim/votings/admin/voting_form.rb', line 43 def scope @scope ||= current_organization.scopes.find_by(id: scope_id) end |