title: How to set prawn pdf filename in Ruby on Rails?
body: <p>What i have is the controller action responding to html and pdf file format like this:</p>
  
  <pre><code>   def detail
        @record = Model.find(params[:id])
        respond_to do |format|
           format.html # detail.html.erb
           format.pdf { render :layout =&gt; false } #detail.pdf.prawn
        end
     end
  </code></pre>
  
  <p>but when i get the file it comes with the name: <code>1.pdf</code> <code>2.pdf</code> depending on the <code>params[:id]</code> how do i set the filename to <code>myfile.pdf</code></p>
  
  <p>--UPDATE--</p>
  
  <p>Example of my <code>detail.pdf.prawn</code> file</p>
  
  <pre>
  <code>
  pdf.font "Helvetica"
  pdf.image open("http://localhost:3000/images/myImage.png"),:position => :left,:width=>100
  pdf.text "some text"
  pdf.table(someData,:cell_style => { :border_width => 0.1,:border_color=> 'C1C1C1' }) do |table|
      table.row(0).style :background_color => 'D3D3D3'
      table.column(0..1).style(:align => :left)
      table.column(2..4).style(:align => :center)
      table.column(0).width = 100
      table.column(1).width = 250
      table.column(3..4).width = 68
      table.row(2).column(0..2).borders = []
      table.row(2).column(3).style(:font_style => :bold, :align => :right)
  end
  </code>
  </pre>
  
  <p>and the <code>format.pdf { render :layout =&gt; false }</code> in the controller renders de pdf file with the instructions on <code>detail.pdf.prawn</code></p>