I want to link to a file outside rails application. It is a text file stored in rails server disk. When user click this link, the file will be open. How can I do this? thanks. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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! On Jan 21, 7:33 pm, Zhao Yi <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I want to link to a file outside rails application. It is a text file > stored in rails server disk. When user click this link, the file will be > open. > > How can I do this? > > thanks. > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi, Try this : <%= link_to "file", "http://www.mysite.com/the_file.doc" %> Regards, Rob On Jan 22, 3:43 pm, Bobnation <boblmart...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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! > > On Jan 21, 7:33 pm, Zhao Yi <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > > > I want to link to a file outside rails application. It is a text file > > stored in rails server disk. When user click this link, the file will be > > open. > > > How can I do this? > > > thanks. > > -- > > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Rob Zolkos wrote:> Hi, > > Try this : > > <%= link_to "file", "http://www.mysite.com/the_file.doc" %> > > Regards, > RobMy 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" %> -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 On Thu, Jan 22, 2009 at 10:58 AM, Zhao Yi <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Rob Zolkos wrote: >> Hi, >> >> Try this : >> >> <%= link_to "file", "http://www.mysite.com/the_file.doc" %> >> >> 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" %> > -- > Posted via http://www.ruby-forum.com/. > > > >-- M@nmay http://manmays.googlepages.com http://manmays.blogspot.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Manmay wrote:> 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'') >I have tried but got undefined method `send_file'' for #<ActionView::Base:0x41222cc0> error, this is my code in *.html.erb: ... <td> <%= send_file (''/tmp/log.txt'', :disposition => ''inline'') -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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_fileI 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? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
what kind of value do you need? you can set :params => {:key => :value} and read them in your controller. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---