Sha256: bd0c7e504875bae01858fe1aa018f34d98d1bdbf4ed1387f239c054f4842c723

Contents?: true

Size: 1.48 KB

Versions: 13

Compression:

Stored size: 1.48 KB

Contents

# frozen_string_literal: true

module Decidim
  module Forms
    module Admin
      module Concerns
        # Url helper for HasQuestionnaireAnswers controller concern
        #
        module HasQuestionnaireAnswersUrlHelper
          def self.included(base)
            base.helper_method :questionnaire_url, :questionnaire_participants_url,
                               :questionnaire_participant_answers_url, :questionnaire_export_response_url
          end

          # You can implement this method in your controller to change the URL
          # where the questionnaire can be edited.
          def questionnaire_url
            url_for(questionnaire.questionnaire_for)
          end

          # You can implement this method in your controller to change the URL
          # where the questionnaire participants' info will be shown.
          def questionnaire_participants_url
            url_for([:index, questionnaire.questionnaire_for, { format: nil }])
          end

          # You can implement this method in your controller to change the URL
          # where the user's questionnaire answers will be shown.
          def questionnaire_participant_answers_url(session_token)
            url_for([:show, questionnaire.questionnaire_for, { session_token: }])
          end

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

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-forms-0.29.1 app/helpers/decidim/forms/admin/concerns/has_questionnaire_answers_url_helper.rb
decidim-forms-0.28.4 app/helpers/decidim/forms/admin/concerns/has_questionnaire_answers_url_helper.rb
decidim-forms-0.29.0 app/helpers/decidim/forms/admin/concerns/has_questionnaire_answers_url_helper.rb
decidim-forms-0.28.3 app/helpers/decidim/forms/admin/concerns/has_questionnaire_answers_url_helper.rb
decidim-forms-0.29.0.rc4 app/helpers/decidim/forms/admin/concerns/has_questionnaire_answers_url_helper.rb
decidim-forms-0.29.0.rc3 app/helpers/decidim/forms/admin/concerns/has_questionnaire_answers_url_helper.rb
decidim-forms-0.29.0.rc2 app/helpers/decidim/forms/admin/concerns/has_questionnaire_answers_url_helper.rb
decidim-forms-0.29.0.rc1 app/helpers/decidim/forms/admin/concerns/has_questionnaire_answers_url_helper.rb
decidim-forms-0.28.2 app/helpers/decidim/forms/admin/concerns/has_questionnaire_answers_url_helper.rb
decidim-forms-0.28.1 app/helpers/decidim/forms/admin/concerns/has_questionnaire_answers_url_helper.rb
decidim-forms-0.28.0 app/helpers/decidim/forms/admin/concerns/has_questionnaire_answers_url_helper.rb
decidim-forms-0.28.0.rc5 app/helpers/decidim/forms/admin/concerns/has_questionnaire_answers_url_helper.rb
decidim-forms-0.28.0.rc4 app/helpers/decidim/forms/admin/concerns/has_questionnaire_answers_url_helper.rb