Module: Decidim::Forms::Admin::Concerns::HasQuestionnaireAnswersUrlHelper

Defined in:
app/helpers/decidim/forms/admin/concerns/has_questionnaire_answers_url_helper.rb

Overview

Url helper for HasQuestionnaireAnswers controller concern

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



10
11
12
13
# File 'app/helpers/decidim/forms/admin/concerns/has_questionnaire_answers_url_helper.rb', line 10

def self.included(base)
  base.helper_method :questionnaire_url, :questionnaire_participants_url,
                     :questionnaire_participant_answers_url, :questionnaire_export_response_url
end

Instance Method Details

#questionnaire_export_response_url(session_token) ⇒ Object



33
34
35
# File 'app/helpers/decidim/forms/admin/concerns/has_questionnaire_answers_url_helper.rb', line 33

def questionnaire_export_response_url(session_token)
  url_for([:export_response, questionnaire.questionnaire_for, { session_token:, format: "pdf" }])
end

#questionnaire_participant_answers_url(session_token) ⇒ Object

You can implement this method in your controller to change the URL where the user’s questionnaire answers will be shown.



29
30
31
# File 'app/helpers/decidim/forms/admin/concerns/has_questionnaire_answers_url_helper.rb', line 29

def questionnaire_participant_answers_url(session_token)
  url_for([:show, questionnaire.questionnaire_for, { session_token: }])
end

#questionnaire_participants_urlObject

You can implement this method in your controller to change the URL where the questionnaire participants’ info will be shown.



23
24
25
# File 'app/helpers/decidim/forms/admin/concerns/has_questionnaire_answers_url_helper.rb', line 23

def questionnaire_participants_url
  url_for([:index, questionnaire.questionnaire_for, { format: nil }])
end

#questionnaire_urlObject

You can implement this method in your controller to change the URL where the questionnaire can be edited.



17
18
19
# File 'app/helpers/decidim/forms/admin/concerns/has_questionnaire_answers_url_helper.rb', line 17

def questionnaire_url
  url_for(questionnaire.questionnaire_for)
end