Rails Helper

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

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>