Can link_to have both an image and some text?


#1

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


#2

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


#3

Thanks, Mark, it worked perfectly.

-Shauna