Hi, i''m trying to list an image taking the url from the DB. The code is: <img src=''<%= image.image_url %>'' width="50"height="75"></img> but it doesn''t show nothing... Can somebody help me?? 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-/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 -~----------~----~----~----~------~----~------~--~---
because you are in rails, why not write this: <%= image_tag(image.image_url, :size=>"50x75") %> and be sure the images exists. you can check this with the help of firebug, a great plug-in for firefox... On 4 Jul., 14:46, abdulKamel <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi, > > i''m trying to list an image taking the url from the DB. > The code is: > > <img src=''<%= image.image_url %>'' width="50"height="75"></img> > > but it doesn''t show nothing... > Can somebody help me?? > > thanks in advance > > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
lanzm wrote:> because you are in rails, why not write this: > > <%= image_tag(image.image_url, :size=>"50x75") %> > > and be sure the images exists. you can check this with the help of > firebug, a great plug-in for firefox...The problem is how to add what''s kind of Url into database from web. -- 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 -~----------~----~----~----~------~----~------~--~---
abdulKamel wrote:> Hi, > > i''m trying to list an image taking the url from the DB. > The code is: > > <img src=''<%= image.image_url %>'' width="50"height="75"></img> > > but it doesn''t show nothing... > Can somebody help me?? > > thanks in advanceI met the same problem with you. I think the problme is the what''s content of image.image_url? Could you tell me what its content ? -- 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 -~----------~----~----~----~------~----~------~--~---
> > Could you tell me what its content ?the content is: /home/andrea/senior/public/images/prova.jpg and it''s the right path.... 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 -~----------~----~----~----~------~----~------~--~---
On Jul 4, 2007, at 9:46 AM, abdulKamel wrote:>> Could you tell me what its content ? > > the content is: > > /home/andrea/senior/public/images/prova.jpg > > and it''s the right path.... > thanksYou only want to give ''/images/prova.jpg'' to the <img> or image_tag. The value is going to be interpretted by the browser so that PATH is not a URL. Unless your routes are also set up to catch this and you''re finding the file and using send_file() to get it back. (NOTE: I''m *not* recommending this!) It looks like you should remove RAILS_ROOT+''/public'' from all of your "url"s -Rob Rob Biedenharn http://agileconsultingllc.com Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> > It looks like you should remove RAILS_ROOT+''/public'' from all of your > "url"s >thanks now it works!!!!!! -- 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 -~----------~----~----~----~------~----~------~--~---