class ConsentFormDownloadsController
Constants
- CONSENT_FORM_TYPES
Public Instance Methods
Source
# File app/controllers/consent_form_downloads_controller.rb, line 8 def show authorize ConsentForm, :download? 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