How to link_to a file out side rails application

That's a good question, and I'll let someone else handle it as I leave work tonight.

However, I might recommend probably starting up one thread on the mailing list and asking your questions in there. Will be easier to keep track of them if they are all in one place. Thanks!

Hi,

Try this :

<%= link_to "file", "http://www.mysite.com/the_file.doc&quot; %>

Regards, Rob

Rob Zolkos wrote:

Hi,

Try this :

<%= link_to "file", "http://www.mysite.com/the_file.doc&quot; %>

Regards, Rob

My problem is that the file is not in Rails application. There is on "http://" start. I just want to point to a local file in the server hard disk. For example: <%= link_to "file", "/tmp/hello.txt" %>

hi Zhao,

u can use send_file to relate the file in u'r file system but not in public dir of u'r rails proj like,

send_file(RAILS_ROOT+"/images_uploaded/"+params[:filename] , :disposition => 'inline')

-manmay

try to put send_file in an action of your controller. http://www.railsbrain.com/api/rails-2.2.2/doc/index.html?a=M000167&name=send_file

MaD wrote:

try to put send_file in an action of your controller. http://www.railsbrain.com/api/rails-2.2.2/doc/index.html?a=M000167&name=send_file

I use link_to to an action and in this action I use send_file method. In this action, how can I get the value of the link_to tag?

what kind of value do you need? you can set :params => {:key => :value} and read them in your controller.