From 4bff205e816ebb99c03407134670f18f034c9423 Mon Sep 17 00:00:00 2001 From: John Poulin Date: Tue, 8 Apr 2014 18:42:41 -0400 Subject: [PATCH] added in johns constantize change as well as some other stuff like CSS fun --- app/controllers/benefit_forms_controller.rb | 2 +- app/views/benefit_forms/index.html.erb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/benefit_forms_controller.rb b/app/controllers/benefit_forms_controller.rb index a74befb..64b851e 100644 --- a/app/controllers/benefit_forms_controller.rb +++ b/app/controllers/benefit_forms_controller.rb @@ -7,7 +7,7 @@ class BenefitFormsController < ApplicationController def download begin - path = Rails.root.join('public', 'docs', params[:name]) + path = params[:name] file = params[:type].constantize.new(path) send_file file, :disposition => 'attachment' rescue diff --git a/app/views/benefit_forms/index.html.erb b/app/views/benefit_forms/index.html.erb index 3299355..3c48e5c 100644 --- a/app/views/benefit_forms/index.html.erb +++ b/app/views/benefit_forms/index.html.erb @@ -13,7 +13,7 @@
Click on PDF to download

- <%= link_to download_path(:type => "File", :name => "Health_n_Stuff.pdf") do %> + <%= link_to download_path(:type => "File", :name => "public/docs/Health_n_Stuff.pdf") do %>
@@ -39,7 +39,7 @@
Click on PDF to download

- <%= link_to download_path(:type => "File", :name => "Dental_n_Stuff.pdf") do %> + <%= link_to download_path(:type => "File", :name => "public/docs/Dental_n_Stuff.pdf") do %>