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.
5e518814b76962fdd1ad0e74dfac5ea7?d=identicon&s=25 Martin Gamsjaeger (Guest)
on 2006-05-09 11: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 Gamsjaeger
Ad7805c9fcc1f13efc6ed11251a6c4d2?d=identicon&s=25 Alex Young (Guest)
on 2006-05-09 11:46
(Received via mailing list)
Martin Gamsjaeger 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?
5e518814b76962fdd1ad0e74dfac5ea7?d=identicon&s=25 Martin Gamsjaeger (Guest)
on 2006-05-09 11:58
(Received via mailing list)
Thank you so much Alex! That works perfect ;)

cheers
Martin
Ad7805c9fcc1f13efc6ed11251a6c4d2?d=identicon&s=25 Alex Young (Guest)
on 2006-05-09 12:01
(Received via mailing list)
Martin Gamsjaeger 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.