Image Link

Hello,
I was having problems with a link_to… How can I use an image as the
link instead of text? For example:

<%= link_to /images/user_edit.gif, :controller => ‘employees’, :action
=> ‘edit’ %>

This doesn’t work… I tried a few variations, such as quotes, double
quotes, curly braces, etc… What is the proper way to do this?

Thanks,

  • Jeff M.

try something like:

<%= link_to image_tag(‘/images/user_edit.gif’), :controller =>
‘employees’, :action

=> ‘edit’ %>

On Mar 11, 5:09 pm, Jeff M. [email protected]

thanks! That worked perfectly!