Class: Decidim::Demographics::Admin::ResponsesController

Inherits:
ApplicationController show all
Includes:
Forms::Admin::Concerns::HasQuestionnaireResponses
Defined in:
decidim-demographics/app/controllers/decidim/demographics/admin/responses_controller.rb

Instance Method Summary collapse

Methods inherited from Admin::ApplicationController

#permission_class_chain, #permission_scope, #user_has_no_permission_path, #user_not_authorized_path

Methods included from Headers::HttpCachingDisabler

#disable_http_caching

Methods included from TranslatableAttributes

#attachment?, #default_locale?

Methods included from NeedsSnippets

#snippets

Methods included from RegistersPermissions

register_permissions

Methods included from NeedsOrganization

enhance_controller, extended, included

Instance Method Details

#indexObject



10
11
12
13
14
15
16
17
18
19
# File 'decidim-demographics/app/controllers/decidim/demographics/admin/responses_controller.rb', line 10

def index
  enforce_permission_to :index, permission_subject

  @query = paginate(collection)
  @participants = participants(@query)
  @total = questionnaire.count_participants
  @survey = questionnaire_for

  render template: "decidim/demographics/admin/responses/index"
end

#permission_subjectObject



21
# File 'decidim-demographics/app/controllers/decidim/demographics/admin/responses_controller.rb', line 21

def permission_subject = :demographics_responses

#questionnaire_export_response_url(id) ⇒ Object



25
# File 'decidim-demographics/app/controllers/decidim/demographics/admin/responses_controller.rb', line 25

def questionnaire_export_response_url(id) = export_response_response_path(id:)

#questionnaire_forObject



23
# File 'decidim-demographics/app/controllers/decidim/demographics/admin/responses_controller.rb', line 23

def questionnaire_for = demographic

#questionnaire_participant_responses_url(id) ⇒ Object

Specify where to redirect after exporting a user response



30
# File 'decidim-demographics/app/controllers/decidim/demographics/admin/responses_controller.rb', line 30

def questionnaire_participant_responses_url(id) = response_path(id:)

#questionnaire_participants_urlObject



32
# File 'decidim-demographics/app/controllers/decidim/demographics/admin/responses_controller.rb', line 32

def questionnaire_participants_url = decidim_admin_demographics.responses_path

#questionnaire_urlObject



27
# File 'decidim-demographics/app/controllers/decidim/demographics/admin/responses_controller.rb', line 27

def questionnaire_url = edit_questions_questions_path