in case someone else has similar problems, the code that I got working
is:
downloading:
--
controller: datafiles_controller
def download
@datafile = Datafile.find(params[:id])
send_file('/var/www/pub.website.com/file_uploads/'+
If I comment out everything in my index action in my
datafiles_controller
and paste in:
send_file('/file_uploads/Productivity.pdf', :disposition
= :attachment)
it works, so obviously, the send_file command is good, the
problem is with my routing. What do I need to add to my
routes.rb file so I can
excellent, ty
On Oct 5, 9:39 am, Luke Cowell lcow...@gmail.com wrote:
resources :datafiles will create some default routes, but they don't include
download. You need to add a member route for the download action.
Are you going to make me do this for you ? ;)
resources :datafiles do
member do
get :download
end
end
And seriously, read this stuff:
http://www.engineyard.com/blog/2010/the-lowdown-on-routes-in-rails-3/
http://guides.rubyonrails.org/routing.html
Luke
On 2010-10-05, at 7:41 AM,
4 matches
Mail list logo