Linking to external file in Ruby on Rails

Posted by Maestro1024 on Stack Overflow See other posts from Stack Overflow or by Maestro1024
Published on 2010-05-23T13:23:50Z Indexed on 2010/05/23 13:30 UTC
Read the original article Hit count: 286

Filed under:
|

Linking to external file in Ruby on Rails

I have a file I want to share as a link in my rails app. I create a link to it in the .erb file like this

<li><a href="somefile.pdf">Some File</a> </li>

When I select the link I get the following error.

Routing Error

No route matches "/pages/somefile.pdf" with {:method=>:get}

Do I really need a route for this? I really just want the save as dialog to popup. Just a link to a file that the user can open or download.

What is the rails way to do this (rails newbie here)?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby