I am currently running Rails 3.1 and am using the latest version of Wicked_pdf to generate the PDF. I set everything up correctly and the PDF files generated are just fine.
However, I want the user to be able to click a button to DOWNLOAD the PDF. Currently, when clicked, the browser displays the PDF file and displays it on the page.
<%= link_to "Download PDF", { :action => "show", :format => :pdf }, class: 'button nice red large radius', target: '_blank'%>
My controller.
def show @curric = Curric.find(params[:id]) respond_to do |format| format.html
I pointed to the send_file file, but I have no idea how to use it in this scenario.
Any help is appreciated.
Ammar source share