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”>
but it doesn’t show nothing…
Can somebody help me??
thanks in advance
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”>
but it doesn’t show nothing…
Can somebody help me??
thanks in advance
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…
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.
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”>
but it doesn’t show nothing…
Can somebody help me??thanks in advance
I 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 ?
Could you tell me what its content ?
the content is:
/home/andrea/senior/public/images/prova.jpg
and it’s the right path…
thanks
It looks like you should remove RAILS_ROOT+’/public’ from all of your
"url"s
thanks now it works!!!
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…
thanks
You only want to give ‘/images/prova.jpg’ to the 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
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs