Wishes to all, Is there any method to display the HTML file with images outside the rails folder. Kindly let me know your views on my above question! Thanks for any helps. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
well i wouldn''t recommend it. You may be able to get FollowSymLinks in apache and make a symlink if you are on unix. Probably what you want is to set up apache with a rewrite rule to pull from a different vhost. those are both fairly complicated. On Mon, Jan 11, 2010 at 9:41 PM, Newb Newb <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Wishes to all, > Is there any method to display the HTML file with images outside the > rails folder. > > > Kindly let me know your views on my above question! > > Thanks for any helps. > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Curtis Schofield wrote:> well i wouldn''t recommend it. > > You may be able to get FollowSymLinks in apache and make a symlink if > you > are on unix. > > Probably what you want is to set up apache with a rewrite rule to pull > from > a different vhost. > > those are both fairly complicated.thanks for the reply. cant rails open a html file which is in the local machine? location would be D:/temp -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Jan 11, 11:41 pm, Newb Newb <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Wishes to all, > Is there any method to display the HTML file with images outside the > rails folder. > > Kindly let me know your views on my above question! > > Thanks for any helps. > -- > Posted viahttp://www.ruby-forum.com/.What exactly are you trying to do? As is, this question doesn''t quite make sense... just drop the html pages and images and whatever other resources in /public and be done with it. If I were to *guess*, mayhaps you have static content that you only want accessible by users authenticated through your app? Something like this may work (completely off the top of my head): -setup the appropriate catchall route, mapping to some action in an AuthenticatedResource controller or somesuch ish -require the user to be logged in -make sure the requested file exists in whatever directory, and if so send_file as necessary (also it''d really really help to use something like mod-xsendfile) Of course this may not at all be what you''re actually trying to do, so let us know what your end goal is. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mon, Jan 11, 2010 at 10:01 PM, Newb Newb <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Curtis Schofield wrote: > > well i wouldn''t recommend it. > > > > You may be able to get FollowSymLinks in apache and make a symlink if > > you > > are on unix. > > > > Probably what you want is to set up apache with a rewrite rule to pull > > from > > a different vhost. > > > > those are both fairly complicated. > > thanks for the reply. > cant rails open a html file which is in the local machine? > location would be D:/tempYou can read and write files in ruby - from into /tmp - but it is generally not too good idea to spread things around to much - -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Jan 12, 12:10 am, pharrington <xenogene...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Jan 11, 11:41 pm, Newb Newb <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > > > Wishes to all, > > Is there any method to display the HTML file with images outside the > > rails folder. > > > Kindly let me know your views on my above question! > > > Thanks for any helps. > > -- > > Posted viahttp://www.ruby-forum.com/. > > What exactly are you trying to do? > > As is, this question doesn''t quite make sense... just drop the html > pages and images and whatever other resources in /public and be done > with it. > > If I were to *guess*, mayhaps you have static content that you only > want accessible by users authenticated through your app? Something > like this may work (completely off the top of my head): > > -setup the appropriate catchall route, mapping to some action in an > AuthenticatedResource controller or somesuch ish > -require the user to be logged in > -make sure the requested file exists in whatever directory, and if so > send_file as necessary (also it''d really really help to use something > like mod-xsendfile) > > Of course this may not at all be what you''re actually trying to do, so > let us know what your end goal is.OK I just read your other thread, and I''m pasting the contents here (multiple threads for the sammmmme exact issue is a terrible way to get your problem resolved): "Dear Friends, I use render :file method to display html file which has images in it . The render file method not displays a HTML file with images that''s exists inside public folder. Both my HTML files and images refereed are in the public folder only. Question 1: how to view that HTML file with images in it Question 2: why render file method is not showing the images in the HTML file and simply shows the HTML content without images Thanks for any helps! " OK. The resources are already in /public. How every Rails app setup works is that files in /public are served directly by the webserver, bypassing your Rails app. So if you have HTML pages in /public, Rails does not need to get involved in their serving at all. EXAMPLE: your site runs from http://localhost. you have a file "d:\railsapp\public \static_content\ish.html." This file can be view by navigating to http://localhost/static_content/ish.html in the web browser. Does this help? If not, *what exactly are you trying to accomplish.* I don''t care how you think you can accomplish it, just say what the end result should be. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Curtis Schofield wrote:> On Mon, Jan 11, 2010 at 10:01 PM, Newb Newb <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> > wrote:Thank u all for the reply. <%= link_to image_tag("backup_configure.png",:title => "view chat"),{:action => "open_live_file",:file_path => @file_path},{:target => ''_new''} %> def open_live_file #-------------- @backup = ChathistoryBackup.find(:first) unless @backup.nil? and params[:file_path].nil? file_path = params[:file_path] if File.exists?("#{file_path}") render :file => "#{file_path}", :layout => false end end end when clicking on the above link it opens the html file on a browser window but it has not shown the images in the html file. In my public folder public/Server_exe/ChatHistory/2010-01-10/2010-01-10\1~Vs~2\1~Vs~2.html => the html file is located in this path for the above html file images are in the following path public/Server_exe/ChatHistory/2010-01-10/1~Vs~2/ScreenCapture/2120100109101048121.jpg => this image is shown in the html file when rendering this file why the images are not shown even its all in public folder Thank u for taking time to reply -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Sorry for annoying. # render :file => "#{file_path}", :layout => false the html file contains images with it when i render the above html file from the public folder it shows the file in a browser window without the images displayed. why it is so?why it cant display the images ? Thanks in advance -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Jan 12, 12:23 am, Newb Newb <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> for the above html file images are in the following path > > public/Server_exe/ChatHistory/2010-01-10/1~Vs~2/ScreenCapture/2120100109101 048121.jpg > => this image is shown in the html fileThis image path is not correct. As I said: "EXAMPLE: your site runs from http://localhost. you have a file "d:\railsapp\public \static_content\ish.html." This file can be view by navigating to http://localhost/static_content/ish.html in the web browser." -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mon, Jan 11, 2010 at 9:32 PM, Newb Newb <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> the html file contains images with itNo, it doesn''t -- it contains tags with URLs of images.> when i render the above html file from the public folder it shows the > file in a browser window without the images displayed. > > why it is so?why it cant display the images ?Because the URLs in the rendered HTML don''t match the URLs of the actual image files on the server. If, instead of reposting the same question over and over, you actually *looked* at the rendered HTML and compared those URLs to what is being provided by your server, you might find the answer. -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
2010/1/12 Newb Newb <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>:> Curtis Schofield wrote: >> well i wouldn''t recommend it. >> >> You may be able to get FollowSymLinks in apache and make a symlink if >> you >> are on unix. >> >> Probably what you want is to set up apache with a rewrite rule to pull >> from >> a different vhost. >> >> those are both fairly complicated. > > thanks for the reply. > cant rails open a html file which is in the local machine? > location would be D:/tempIf you wish to open a file on the local machine (where browser and rails are running on the same PC) then I suppose you can use the file:// syntax. Note that this will not work if you access the rails app from a different machine. Otherwise you can access files anywhere that your web server can pick them up from, just put the full uri of the file. Colin -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.