# 'alt' and 'title' tags :/

**URL:** <https://www.ruby-forum.com/t/alt-and-title-tags/181275>\
**Category:** Rails\
**Created:** [January 8, 2010, 5:18pm UTC](https://www.ruby-forum.com/t/alt-and-title-tags/181275 "2010-01-08T17:18:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mercurius](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@mercurius](https://www.ruby-forum.com/u/mercurius)\
**Post date:** [January 8, 2010, 5:18pm UTC](https://www.ruby-forum.com/t/alt-and-title-tags/181275/1 "2010-01-08T17:18:03Z")

</div>

\<%= 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  
☹

---

<div class="post-metadata">

**Author:** ![mercurius](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@mercurius](https://www.ruby-forum.com/u/mercurius)\
**Post date:** [January 8, 2010, 5:52pm UTC](https://www.ruby-forum.com/t/alt-and-title-tags/181275/2 "2010-01-08T17:52:59Z")

</div>

Pale H. 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  
> ☹

Apologies, I’ve realised the problem 🙂

\<%= link\_to (scale\_image\_tag testimonial.picture1, :height =\> 110,  
:width =\> 110, :border =\> “0”), {:action =\> “show”, :id =\> testimonial},  
:title =\> testimonial.quote %\>

---

<div class="post-metadata">

**Author:** ![mercurius](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@mercurius](https://www.ruby-forum.com/u/mercurius)\
**Post date:** [January 8, 2010, 8:08pm UTC](https://www.ruby-forum.com/t/alt-and-title-tags/181275/3 "2010-01-08T20:08:45Z")

</div>

On Jan 8, 2010, at 11:52 AM, Pale H. wrote:

> > ☹
> 
> Apologies, I’ve realised the problem 🙂
> 
> ## \<%= 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 B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
removed\_email\_address@domain.invalid
