'alt' and 'title' tags :/

<%= link_to (scale_image_tag testimonial.picture1, :alt => "dyjdcgyhjk",
:title => "dxtykdyj", :height => 110, :width => 110, :border => "0"),
{:action => "show", :id => testimonial} %>

What am I doing wrong with ':alt => "dyjdcgyhjk", :title => "dxtykdyj"'
to make it not work? I've looked in the source code and both are empty
:frowning:

Pale Horse wrote:

<%= link_to (scale_image_tag testimonial.picture1, :alt => "dyjdcgyhjk",
:title => "dxtykdyj", :height => 110, :width => 110, :border => "0"),
{:action => "show", :id => testimonial} %>

What am I doing wrong with ':alt => "dyjdcgyhjk", :title => "dxtykdyj"'
to make it not work? I've looked in the source code and both are empty
:frowning:

Apologies, I've realised the problem :slight_smile:

<%= link_to (scale_image_tag testimonial.picture1, :height => 110,
:width => 110, :border => "0"), {:action => "show", :id => testimonial},
:title => testimonial.quote %>

<%= link_to scale_image_tag(testimonial.picture1, :height => 110,
                             :width => 110, :border => "0"),
             {:action => "show", :id => testimonial},
             :title => testimonial.quote %>

Without adding more parentheses, I just wanted to suggest (to you and anyone else reading) that you actually use parentheses to surround the method arguments to scale_image_tag rather than use them to group the arguments. If the space after 'link_to' was removed, the entire parenthetical group would result in a syntax error.

Omitting parentheses can be a nice thing, but when you need them, you really need to put them in the right place.

I'd also recommend surrounding the arguments to link_to with their own set of parentheses.

-Rob

Rob Biedenharn http://agileconsultingllc.com
Rob@AgileConsultingLLC.com