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

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.
Shauna (Guest)
on 2007-01-20 10:46
I can do:
  <%= link_to "Print", {:action => 'print_list'}, ...
or
  <%= 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
file?

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

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

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


--
Mark Van H.
removed_email_address@domain.invalid
http://lotswholetime.com
Shauna (Guest)
on 2007-01-20 21:45
Thanks, Mark, it worked perfectly.

-Shauna
This topic is locked and can not be replied to.