I think your <img src=''<% @pic %>''
width="50" height="75"></img> is wrong
you can writen it like this : <img src=''<%= @pic %>''
width="50"
height="75"></img>
<%=%> evaluate the ruby expression., this can return result of the
expression.
<%%> ddeclare ruby expression or statement.
2006/5/18, Ben Lisbakken
<lisbakke-DG7SOAwx7rg@public.gmane.org>:>
> I am only 3 days into rails, so please excuse the stupid question.
>
> I am trying to access my database named Movies. I am using a table
> named movie. I would like to pull the table entry with field
> vname=rawr, and then take this entry''s field vpic, and use that
vpic
> (assume its a url to an image) to display an image.
>
> To begin with, I am having problems with displaying an image with
> html + ruby. In my index.rhtml I have two lines:
> <% @pic = ''http://www.showfly.net/img/1.jpg'' %>
> <img src=''<% @pic %>'' width="50"
height="75"></img>
>
> And it doesn''t display the image. What did I do wrong? How do I
> make the @pic be the url that i did a search for in my database?
>
> Thank you,
> Ben
> _______________________________________________
> Rails-spinoffs mailing list
> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs