diff --git a/app/controllers/benefit_forms_controller.rb b/app/controllers/benefit_forms_controller.rb index bac8b7f..5684bcf 100644 --- a/app/controllers/benefit_forms_controller.rb +++ b/app/controllers/benefit_forms_controller.rb @@ -12,4 +12,21 @@ class BenefitFormsController < ApplicationController end end +=begin + # More secure version + def download + file_assoc = {"1" => "Health_n_Stuff.pdf", "2" => "Dental_n_Stuff.pdf"} + begin + if file_assoc.has_key?(params[:name].to_s) + file = Rails.root.join('public', 'docs', file_assoc[params[:name].to_s]) + send_file file, :disposition => 'attachment' + else + file = Rails.root.join('public', 'docs', "Dental_n_Stuff.pdf") + end + rescue + redirect_to user_benefit_forms_path(:user_id => current_user.user_id) + end + end +=end + end diff --git a/app/views/layouts/tutorial/constantize/_benefit_forms_constantize.html.erb b/app/views/layouts/tutorial/constantize/_benefit_forms_constantize.html.erb index e69de29..41a59f0 100644 --- a/app/views/layouts/tutorial/constantize/_benefit_forms_constantize.html.erb +++ b/app/views/layouts/tutorial/constantize/_benefit_forms_constantize.html.erb @@ -0,0 +1,125 @@ +
\ No newline at end of file