I get the same result with canvas false. Am I doing this correctly?
Here’s the view code:
<% link_to download_quizzes_path, :canvas => false do %>
<%= image_tag "pdf.png", :size => "52x52", :alt => "Download now!" -%>
<% end %>
And here’s the controller code:
def download
send_file 'public/my_pdf_file.pdf', :type => 'application/pdf', :disposition => 'attachment'
end
And this is what shows up in the browser:
<a href="/my_app_name/quizzes/download" canvas="false">
<img alt="Download now!" height="52" src="http://x.x.x.x:3000/images/pdf.png?1265111338" width="52" />
</a>
When I click the link, I get the same garbage in the canvas as before.
Do I also need to set layout to false for the download action? I’ll try that when I get a chance.