Files
railsgoat/app/controllers/benefit_forms_controller.rb
T
2013-06-02 22:42:50 -04:00

16 lines
319 B
Ruby

class BenefitFormsController < ApplicationController
def index
end
def download
begin
file = Rails.root.join('public', 'docs', params[:name])
send_file file, :disposition => 'attachment'
rescue
redirect_to user_benefit_forms_path(:user_id => current_user.user_id)
end
end
end