Class: Decidim::Forms::Admin::QuestionForm

Inherits:
Decidim::Form
  • Object
show all
Includes:
TranslatableAttributes
Defined in:
decidim-forms/app/forms/decidim/forms/admin/question_form.rb

Overview

This class holds a Form to update questionnaire questions from Decidim's admin panel.

Instance Method Summary collapse

Methods included from TranslatableAttributes

#default_locale?

Instance Method Details

#number_of_optionsObject


37
38
39
# File 'decidim-forms/app/forms/decidim/forms/admin/question_form.rb', line 37

def number_of_options
  answer_options.size
end

#separator?Boolean

Returns:

  • (Boolean)

41
42
43
# File 'decidim-forms/app/forms/decidim/forms/admin/question_form.rb', line 41

def separator?
  question_type == Decidim::Forms::Question::SEPARATOR_TYPE
end

#to_paramObject


31
32
33
34
35
# File 'decidim-forms/app/forms/decidim/forms/admin/question_form.rb', line 31

def to_param
  return id if id.present?

  "questionnaire-question-id"
end