Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rails: how to have an image for the submit tag?

Tags:

I have been using submit tag helpers.

<%= submit_tag 'Submit' %> 

I have an image called my_image.png.

How can I make the submit button be an image?

I tried:

    <%= submit_tag '#{image_tag("Login_small.png", :width=>70)}' %> 

But that doesn't work..

like image 692
Katyal Avatar asked Jan 31 '10 03:01

Katyal


2 Answers

Check out image_submit_tag, it is what you are looking for. It is used like image_submit_tag("login.png")

like image 153
Rob Di Marco Avatar answered Sep 21 '22 14:09

Rob Di Marco


I believe you'd like to use image_submit_tag.

See the docs for more details.

like image 39
JAL Avatar answered Sep 21 '22 14:09

JAL