class ProgrammesController
Constants
- CONSENT_FORM_TYPES
Public Instance Methods
Source
# File app/controllers/programmes_controller.rb, line 15 def consent_form type = params[:type] raise ActiveRecord::RecordNotFound unless CONSENT_FORM_TYPES.include?(type) path = "public/consent_forms/#{type}.pdf" name = I18n.t(type, scope: :programme_types) filename = "#{name} Consent Form.pdf" send_file(path, filename:, disposition: "attachment") end
Source
# File app/controllers/programmes_controller.rb, line 9 def index @programmes = current_user.programmes end