What's the best way to create a download link? Is there a better way than the following?
I was thinking of using link_to "Download", :controller => ..., :action => ...", :id => ...
in the view.
Adding match /documents/download/:id => documents#download
to routes.rb
And in the controller:
def download
send_file ...
end
Also, I'd like, if possible, for the user to remain on the same page as the link.
Thanks.