button_to_function with image?

Mike,

   > does button_to_function allow the use of an image? I tried it in place    > of the text with "image_tag" and it doesn't work. Maybe some form of    > button_to?

I couldn't find a way to pass an image as parameter, but you can fabricate it yourself.

  <%= content_tag(:button, image_tag("ok.png")+"Submit", :type => "submit") %>

A good candidate for a helper.

Alain Ravet

Mike,

   > But here's what I did:    > <%= content_tag(:button, image_tag("btn_send.gif"), :type => "submit", :onclick => "closeiframe();") %>    > So when I do this, it puts a button-box around "image_tag".

Yep. That's what you're looking for, arent't you? see:     Particletree » Rediscovering the Button Element

Note: if you don't need text in the button, there is :    image_submit_tag    http://api.rubyonrails.com/classes/ActionView/Helpers/FormTagHelper.html#M000613

Alain Ravet