title: rails how to render a file with correct filename
body: <p>This is tough one to explain so i'll try my best, and hopefully edit the question if people need more information. I am not providing exact code, but merely an example of the issue.</p>
  
  <p>I am using rails 2.3.8. I am on Unix.</p>
  
  <p>I have a bunch of files under a directory not Apache accessible. (i.e. /data/files/file.rpk)</p>
  
  <p>I have the following in my view.</p>
  
  <pre><code>link_to "RPK File", :controller =&gt; 'mycontroller', :action=&gt; 'myaction', :file =&gt; '/data/files/file.rpk' 
  </code></pre>
  
  <p>I have the following in my controller.</p>
  
  <pre><code>def myaction
    if FileTest.exists?(params[:file])
      render :file =&gt; params[:file]  
    end
  end
  </code></pre>
  
  <p>When i select the link on the page i get a download prompt for my desired file, but the name of the file is "myaction" instead of the filename.</p>
  
  <p>Thoughts on how i could get it named correctly?</p>