Module: SurveyorGui::QuestionsHelper
- Included in:
- QuestionGroupsHelper
- Defined in:
- app/helpers/surveyor_gui/questions_helper.rb
Instance Method Summary collapse
- #adjusted_text ⇒ Object
- #link_to_remove_fields(name, f, dom_to_hide = nil) ⇒ Object
- #question_type_subset(args) ⇒ Object
Instance Method Details
#adjusted_text ⇒ Object
6 7 8 9 10 11 12 |
# File 'app/helpers/surveyor_gui/questions_helper.rb', line 6 def adjusted_text if @question.part_of_group? @question.question_group.text else @question.text end end |
#link_to_remove_fields(name, f, dom_to_hide = nil) ⇒ Object
2 3 4 |
# File 'app/helpers/surveyor_gui/questions_helper.rb', line 2 def link_to_remove_fields (name, f, dom_to_hide=nil) f.hidden_field(:_destroy) + link_to(image_tag("delete.png",:border => 0, :margin=>'-1em'), "#", onclick: "remove_fields(this, \"#{dom_to_hide}\");") end |
#question_type_subset(args) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'app/helpers/surveyor_gui/questions_helper.rb', line 14 def question_type_subset(args) question_types = QuestionType.all.map{|t|[t.text, t.id]}[0..19].uniq ordered_types = [] args.each do |id| ordered_types << question_types.select{|t| id == t[1]}.flatten end ordered_types end |