Forum: Ruby on Rails Named link to image

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Martin G. (Guest)
on 2006-05-09 13:27
(Received via mailing list)
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.
Alex Y. (Guest)
on 2006-05-09 13:46
(Received via mailing list)
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(...) + '<br />Open', :action => 'foo', ... %>

Won't that do the trick?
Martin G. (Guest)
on 2006-05-09 13:58
(Received via mailing list)
Thank you so much Alex! That works perfect ;)

cheers
Martin
Alex Y. (Guest)
on 2006-05-09 14:01
(Received via mailing list)
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
This topic is locked and can not be replied to.