Named link to image

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.

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?

Thank you so much Alex! That works perfect :wink:

cheers
Martin

Martin G. wrote:

Thank you so much Alex! That works perfect :wink:
No worries :slight_smile:

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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs