From: Florian Gilcher Date: 2008-07-24T04:27:54+09:00 Subject: Re: read document in browser itself -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Jul 23, 2008, at 4:07 PM, Eleanor McHugh wrote: > On 23 Jul 2008, at 12:26, Sujith Gangaraju 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 >> >> pls any body reply soon pls > > Well to display it in the browser you're going to have to download > it into the browser, at which point it becomes a JavaScript problem. > Have you considered asking on any of the JavaScript mailing lists > whether an appropriate in-browser renderer exists? Or alternately > you could try the various Rails mailing lists as it's possible > someone else has run into the same problem. > This has nothing to do with JavaScript, but with the disposition method. By default, files will be delivered as an attachment, what you want is called "inline". AFAIK, this can be done via #send_file. It would be best to ask that question on the Rails mailing list, not the pure Ruby one. Regards, Florian Gilcher > ---- > raise ArgumentError unless @reality.responds_to? :reason Hehe, I like that one. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) iEYEARECAAYFAkiHh4sACgkQJA/zY0IIRZaJvwCgp634HUFZkY6QJ+H7x3q6Fgva 1ggAn3OzjIcQUeYyIRNh4r8x17bGp9/D =Wj7J -----END PGP SIGNATURE-----