Welcome Guest | Login

bizzare image_tag behavior

Hi,

Can anyone tell me why the following code in a helper method

$stdout.puts image_tag("ravenala_v1.png")

would produce the following output

<img alt="Ravenala_v1" src="/images/ravenala_v1.png?1182127556" />

instead of

<img alt="Ravenala_v1" src="/images/ravenala_v1.png" />

It looks like some kind of strange GET parameter has been appended.

Thanks in advance...
- Peter

2007-07-27 06:00 PM

Rails does that automatically to prevent browser caching.  You should just use

<img alt="Ravenala_v1" src="/images/ravenala_v1.png" />

in your code.

Also, you should avoid puts calls if you're ever using apache (they don't play nice).  

2007-07-28 02:49 AM

Thanks, the browser caching makes sense..
(and yes the puts is only for development with webbrick)
- Peter

2007-07-29 02:04 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up today!