# Named link to image

**URL:** <https://www.ruby-forum.com/t/named-link-to-image/60001>\
**Category:** Rails\
**Created:** [May 9, 2006, 11:27am UTC](https://www.ruby-forum.com/t/named-link-to-image/60001 "2006-05-09T11:27:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![martin-ga](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc348/32.png) [@martin-ga](https://www.ruby-forum.com/u/martin-ga)\
**Post date:** [May 9, 2006, 11:27am UTC](https://www.ruby-forum.com/t/named-link-to-image/60001/1 "2006-05-09T11:27:58Z")

</div>

Hiall,

Call me stupid if you like .,) but it seems i can’t figure out how to  
get a named link using a combination of link\_to and image\_tag. What I  
need is basically a link displaying a name along with some image to  
indicate status (open,working,finished). I found no combination of  
link\_to and image\_tag that accepts a name, this seems to be solely  
used for making whole images into links … What is it that I don’t  
get :)?

TIA  
Martin G.

---

<div class="post-metadata">

**Author:** ![martin-ga](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc348/32.png) [@martin-ga](https://www.ruby-forum.com/u/martin-ga)\
**Post date:** [May 9, 2006, 11:46am UTC](https://www.ruby-forum.com/t/named-link-to-image/60001/2 "2006-05-09T11:46:11Z")

</div>

Martin G. wrote:

> Hiall,
> 
> Call me stupid if you like .,) but it seems i can’t figure out how to  
> get a named link using a combination of link\_to and image\_tag. What I  
> need is basically a link displaying a name along with some image to  
> indicate status (open,working,finished). I found no combination of  
> link\_to and image\_tag that accepts a name, this seems to be solely  
> used for making whole images into links … What is it that I don’t  
> get :)?

\<%= link\_to image\_tag(…) + ‘  
Open’, :action =\> ‘foo’, … %\>

Won’t that do the trick?

---

<div class="post-metadata">

**Author:** ![martin-ga](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc348/32.png) [@martin-ga](https://www.ruby-forum.com/u/martin-ga)\
**Post date:** [May 9, 2006, 11:58am UTC](https://www.ruby-forum.com/t/named-link-to-image/60001/3 "2006-05-09T11:58:42Z")

</div>

Thank you so much Alex! That works perfect 😉

cheers  
Martin

---

<div class="post-metadata">

**Author:** ![martin-ga](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc348/32.png) [@martin-ga](https://www.ruby-forum.com/u/martin-ga)\
**Post date:** [May 9, 2006, 12:01pm UTC](https://www.ruby-forum.com/t/named-link-to-image/60001/4 "2006-05-09T12:01:54Z")

</div>

Martin G. wrote:

> Thank you so much Alex! That works perfect 😉  
> No worries 🙂

With so much magic going on, it’s quite easy to forget that in a lot of  
cases, you’re just dealing with strings…

–  
Alex
