Rails 3 - link_to image in ruby 1.8 and 1.9

754 Views Asked by At

I have upgraded my localhost version of ruby from 1.8.7 to 1.9.2 and I got some errors in my templates. For example, in ruby 1.8.7 I use following:

    <%= link_to ((image_tag 'image.png', :alt => 'bla bla bal'),
            url_for(root_url), :id => 'identifier')%>

This works me fine on ruby 1.8.7, but if I switch to ruby 1.9.2, I'll get this error:

syntax error, unexpected ',', expecting ')'
                url_for(root_url), :id => 'identifier'));@output_buffer.safe_concat('

What is here for a problem? And could anyone help me, please, how to fix it?

1

There are 1 best solutions below

0
On

ok, so it looks the only right answer it <%= link_to image_tag('image.png', :alt => 'bla bla bal'), root_url, :id => 'identifier'%>. It works on the both versions, 1.8.7 and 1.9.2