Class: Decidim::Surveys::SurveyForm
- Defined in:
- decidim-surveys/app/forms/decidim/surveys/survey_form.rb
Overview
This class holds a Form to answer a surveys from Decidim’s public page.
Instance Method Summary collapse
-
#map_model(model) ⇒ Object
Private: Create the answers from the survey questions.
Methods inherited from Form
Instance Method Details
#map_model(model) ⇒ Object
Private: Create the answers from the survey questions
Returns nothing.
15 16 17 18 19 |
# File 'decidim-surveys/app/forms/decidim/surveys/survey_form.rb', line 15 def map_model(model) self.answers = model.questions.map do |question| SurveyAnswerForm.from_params(question_id: question.id) end end |