I'd like to know what book.logo_url looks like, but most likely, its one of these two:

image_tag book.logo_url
OR
image_tag "/#{book.logo_url}"

Important note:

image_tag calls image_path, which will only prepend the /images directory if the path passed to it doesn't start with a "/" This means if you have an image not stored in your images directory, you can do this:

image_tag '/some_other_directory/my_image.jpg'

On Feb 23, 2007, at 10:51 AM, Kevin Burk wrote:

I'm working with a list template and want to use the image_tag to keep the path to my images constant. The challenge is that I need to dynamically pass the URL to the image tag. What's the correct syntax for this? The standard syntax:


<%= image_tag  "logo.jpg" %>

doesn't apply because I need to pass "book.logo_url" to the image_tag.

If I was using absolute paths, it would be

<img src="<%= book.logo_url %>" />

How do I combine the two?

Thanks,

Kevin Burk
--
***************************************
BURK DESIGN GROUP
http://www.BurkDesignGroup.com
mailto:[EMAIL PROTECTED]
6161 El Cajon Blvd #306
San Diego, CA 92115
PHONE (619) 583-2311
FAX (619) 583-5801
***************************************
_______________________________________________
Sdruby mailing list
[email protected]
http://lists.sdruby.com/mailman/listinfo/sdruby

_______________________________________________
Sdruby mailing list
[email protected]
http://lists.sdruby.com/mailman/listinfo/sdruby

Reply via email to