Forum: Ruby on Rails instance variable as source in image_tag

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Feb07800df6c28161148d0aef48b5fca?d=identicon&s=25 Tom Bell (tombell)
on 2007-01-20 03:03
I would like to use an instance variable as the source in my image tag.
Is something like this possible?  For example:

<%= image_tag(@new_image) %>

linked to an action that uses a model with:

@new_image = "some_image.jpg"
70ca58d0e0e0eabbdb74d177417d09d7?d=identicon&s=25 (Guest)
on 2007-01-20 14:34
(Received via mailing list)
If it's an instance variable from a model, you'll have to go
attr_reader :thingie in the model, and
This topic is locked and can not be replied to.