I am very new to ruby, just 10 days, I have uploade my images to public/pictures/<user_id>/<image.jpg | .png | .gif>. Now I want to display this image on show.rhtml.erb, but I could not found any option to display it on the browser. I took the whole path and the image name in @global variable and then show it on the <img src="<%= @global %>" > imgpath="#{RAILS_ROOT} / PUBLIC/...../image.jpg" I tried it without Rails root and pulic, but no luck. Any one can help me to display images. Thanks In Advance. Abhijit --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Ruby wrote:> I am very new to ruby, just 10 days, I have uploade my images to > public/pictures/<user_id>/<image.jpg | .png | .gif>. > > Now I want to display this image on show.rhtml.erb, but I could not > found any option to display it on the browser. > > I took the whole path and the image name in @global variable and then > show it on the <img src="<%= @global %>" > > > imgpath="#{RAILS_ROOT} / PUBLIC/...../image.jpg" > > I tried it without Rails root and pulic, but no luck. > > Any one can help me to display images. > > Thanks In Advance. > > AbhijitIf you don''t want to worry about handling this stuff try attachment_fu http://clarkware.com/cgi/blosxom/2007/02/24#FileUploadFu -- 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 -~----------~----~----~----~------~----~------~--~---
roland.mai-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2008-Mar-01 19:25 UTC
Re: How ro display Image
simply <img src="/pictures/image.jpg"> On Mar 1, 12:56 pm, Ruby <abhi...-Y1mv+Dyx6Lfk1uMJSBkQmQ@public.gmane.org> wrote:> I am very new to ruby, just 10 days, I have uploade my images to > public/pictures/<user_id>/<image.jpg | .png | .gif>. > > Now I want to display this image on show.rhtml.erb, but I could not > found any option to display it on the browser. > > I took the whole path and the image name in @global variable and then > show it on the <img src="<%= @global %>" > > > imgpath="#{RAILS_ROOT} / PUBLIC/...../image.jpg" > > I tried it without Rails root and pulic, but no luck. > > Any one can help me to display images. > > Thanks In Advance. > > Abhijit--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I''ve found the only way so far is to use image_tag . From rails tutorial, <%= image_tag("image_name" , :size => "300x210" )%> the images need to be inside the app, i''ve used the app/assets/images location, there''s system and public also available, but then you need to add path info. good luck On Saturday, March 1, 2008 9:56:34 AM UTC-8, Ruby wrote:> > I am very new to ruby, just 10 days, I have uploade my images to > public/pictures/<user_id>/<image.jpg | .png | .gif>. > > Now I want to display this image on show.rhtml.erb, but I could not > found any option to display it on the browser. > > I took the whole path and the image name in @global variable and then > show it on the <img src="<%= @global %>" > > > imgpath="#{RAILS_ROOT} / PUBLIC/...../image.jpg" > > I tried it without Rails root and pulic, but no luck. > > Any one can help me to display images. > > Thanks In Advance. > > Abhijit-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d7179a9c-43b0-4371-925e-013b64f8782f%40googlegroups.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
On 1 June 2013 16:48, bob blanton <bobb.delsol-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''ve found the only way so far is to use image_tag . From rails tutorial, > <%= image_tag("image_name" , :size => "300x210" )%> the images need to be > inside the app, i''ve used the app/assets/images location, there''s system > and public also available, but then you need to add path info.Bob, did you realise that you responded to a question that is 5 years old? Colin> > good luck > > On Saturday, March 1, 2008 9:56:34 AM UTC-8, Ruby wrote: >> >> I am very new to ruby, just 10 days, I have uploade my images to >> public/pictures/<user_id>/<image.jpg | .png | .gif>. >> >> Now I want to display this image on show.rhtml.erb, but I could not >> found any option to display it on the browser. >> >> I took the whole path and the image name in @global variable and then >> show it on the <img src="<%= @global %>" > >> >> imgpath="#{RAILS_ROOT} / PUBLIC/...../image.jpg" >> >> I tried it without Rails root and pulic, but no luck. >> >> Any one can help me to display images. >> >> Thanks In Advance. >> >> Abhijit > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msgid/rubyonrails-talk/d7179a9c-43b0-4371-925e-013b64f8782f%40googlegroups.com?hl=en-US. > For more options, visit https://groups.google.com/groups/opt_out. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLverzYK9opTeU3sDJV-nmQYbEMpadwGMpEJrqnzzOuQMg%40mail.gmail.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 1 June 2013 16:48, bob blanton <bobb.delsol-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:[snip]> Bob, did you realise that you responded to a question that is 5 years old? > > Colin > > > > On Saturday, March 1, 2008 9:56:34 AM UTC-8, Ruby wrote:I am *so* glad I''m not the only one this has happened to this week.... (different list, same issue...) -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/51ab9409.3431320a.2dc1.ffffb7b7%40mx.google.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.