Forum: Ruby on Rails Can link_to have both an image and some text?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Shauna (Guest)
on 2007-01-20 10:46
I can do:
  <%= link_to "Print", {:action => 'print_list'}, ...
  <%= link_to image_tag("icon_print.gif", :border=>0), {:action =>
'print_list'}, ...

but is there some way to use both the image and the word "Print", or do
I have to figure out some way of getting the word "Print" into the image

Mark Van H. (Guest)
on 2007-01-20 10:54
(Received via mailing list)

<%= link_to "Print " + image_tag( "icon_print.gif", :border => 0 ),
=> 'print_list' %>

On 1/20/07, Shauna <removed_email_address@domain.invalid> wrote:
> file?
> Thanks,
> Shauna
> --
> Posted via
> >

Mark Van H.
Shauna (Guest)
on 2007-01-20 21:45
Thanks, Mark, it worked perfectly.

This topic is locked and can not be replied to.