Forum: Ruby on Rails Rails Helper

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.
3083ca8f0496edaac2fa10c20630d0bc?d=identicon&s=25 Newb Newb (newb)
on 2009-02-18 05:24
this is html generated code.
<a href="images/image-1.jpg" rel="lightbox" title="my caption">image

is it possible to use Rails code instead of the above one.
if possible to use Rails helper means which would generate html code
like above
Ef0db53920b243d6758c2f6b1306df0d?d=identicon&s=25 Steve Ross (cwd)
on 2009-02-18 05:52
(Received via mailing list)
def link_to_image(image_number, caption)
   link_to("image ##{image_number}", "images/image-
#{image_number}", :rel => 'lightbox', :title => caption)

 >> puts link_to_image(3, 'third image')
<a href="images/image-3" rel="lightbox" title="third image">image #3</a>
This topic is locked and can not be replied to.