[Rails] Re: send_file Rails3, Ruby 1.9.2

2010-10-18 Thread Smashing
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/'+

[Rails] Re: send_file Rails3, Ruby 1.9.2

2010-10-05 Thread Smashing
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

[Rails] Re: send_file Rails3, Ruby 1.9.2

2010-10-05 Thread Smashing
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.

Re: [Rails] Re: send_file Rails3, Ruby 1.9.2

2010-10-05 Thread Luke Cowell
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,