button_to with image

103 views
Skip to first unread message

Tim Slattery

unread,
Aug 10, 2012, 1:59:33 PM8/10/12
to rubyonra...@googlegroups.com
I'm calling button_to in my page, and it renders a form with a submit
button just fine. But what I'd really like is

<input type="img" src="myimage.png" .....>

instead of

<input type="submit...>

button_to doesn't seem able to do this, :type and :src parameters get
ignored. Is there a way to do it?

--
Tim Slattery
Slatt...@bls.gov

Tim Shaffer

unread,
Aug 10, 2012, 2:14:49 PM8/10/12
to rubyonra...@googlegroups.com, slatt...@bls.gov
If the button is to submit a form, you can use image_tag_submit


Otherwise, you can just use link_to(image_tag(...))
Reply all
Reply to author
Forward
0 new messages