Rails Helper

hi..
this is html generated code.
<a href="images/image-1.jpg" rel="lightbox" title="my caption">image
#1</a>

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

def link_to_image(image_number, caption)
   link_to("image ##{image_number}", "images/image-
#{image_number}", :rel => 'lightbox', :title => caption)
end

>> puts link_to_image(3, 'third image')
<a href="images/image-3" rel="lightbox" title="third image">image #3</a>