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.
558a1355cd9f2584c80afdd92ec984d2?d=identicon&s=25 Shauna (Guest)
on 2007-01-20 09: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
3bef3fc4d0cbcf58f3d66c106e2fd16f?d=identicon&s=25 Mark Van Holstyn (Guest)
on 2007-01-20 09:54
(Received via mailing list)
Sure.

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

On 1/20/07, Shauna <rails-mailing-list@andreas-s.net> wrote:
> file?
>
> Thanks,
> Shauna
>
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>


--
Mark Van Holstyn
mvanholstyn@gmail.com
http://lotswholetime.com
558a1355cd9f2584c80afdd92ec984d2?d=identicon&s=25 Shauna (Guest)
on 2007-01-20 20:45
Thanks, Mark, it worked perfectly.

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