On 07 Jun 2010, at 06:37, Stephen Kilbourn wrote:
I'm pretty new to Ruby On Rails (and somewhat self-taught), so bear
with
me if I'm asking something stupid. So whenever I push my download
button
(which just uses send_file, if that's any help) it reloads the page,
without downloading, and it puts the authenticity_token in the url.
This
all the button is:
<% form_remote_tag :url => { :action => 'download'} do %>
<%= submit_tag "Download" %>
<% end %>
Basically, it's just not working at all, and I would appreciate any
sort
of help with the issue. Thanks in advance.
Downloading a file is a "full page refresh" (although the page won't
actually refresh). You shouldn't use an AJAX function (whether that's
a link or a form) to send a file to the client. Just serve it up with
the right content type as a normal request and you'll be fine.
Best regards
Peter De Berdt
--
You received this message because you are subscribed to the Google Groups "Ruby on
Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.