Rails Helper

hi…
this is html generated code.
image
#1

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’)
image #3