i want to open word document file in browser, it means there will be one hyperlink if i click(ex: it''s file.doc) on that it has to open the file in the browser. -- 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 -~----------~----~----~----~------~----~------~--~---
link_to("whatever", "/docs/file.doc") if file.doc is in a folder named docs in the public folder what exactly happens in the browser would depend on the users settings. most likely the browser would ask him to save it --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thorsten Mueller wrote:> link_to("whatever", "/docs/file.doc") > > if file.doc is in a folder named docs in the public folder > > what exactly happens in the browser would depend on the users > settings. > most likely the browser would ask him to save itit will download the file , but i dont want to download the file, i just want to read the file in browser itself -- 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 -~----------~----~----~----~------~----~------~--~---
Make sure you set the :disposition parameter to :inline. By default (:attachment) it gets streamd for download. send_data ''/files/my.doc'', :disposition=>:inline http://www.railsbrain.com/api/rails-2.1.0/doc/index.html?a=M000271&name=send_data On Jul 23, 7:02 am, Sujith Gangaraju <rails-mailing-l...@andreas- s.net> wrote:> Thorsten Mueller wrote: > > link_to("whatever", "/docs/file.doc") > > > if file.doc is in a folder named docs in the public folder > > > what exactly happens in the browser would depend on the users > > settings. > > most likely the browser would ask him to save it > > it will download the file , but i dont want to download the file, > i just want to read the file in browser itself > -- > 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 -~----------~----~----~----~------~----~------~--~---