thetron / css3buttons_rails_helpers

Rails helpers to generate beautiful css3 buttons, based on the 'css3-github-buttons'
http://nicolasgallagher.com/lab/css3-github-buttons/
MIT License
311 stars 29 forks source link

Use button tag for button_submit_tag #6

Closed austvik closed 13 years ago

austvik commented 13 years ago

https://github.com/necolas/css3-github-buttons says: "A range of icons can be added (only for links and buttons)"

This diff uses button tag instead of input tag so that the icons are shown on *_button_submit_tag

thetron commented 13 years ago

Thanks Jørgen. I definitely agree that there should be an option to use the <button> tag instead of the <input type="submit"> tag.

However, the intention with the button_submit_tag method was to directly override the rails built-in submit_tag method, so as to provide the cleanest possible upgrade and downgrade path when installing or uninstalling css3buttons. In your diff, a few of the html options for the rails submit_tag call would be lost.

I think there is definitely room here to add an extra css3button method, perhaps using methods that end in _button_tag, to enable this functionality. What do you think?

austvik commented 13 years ago

Yes, you are right.

Your solution is better since it allows input type=submit for those that really needs it, and button for those that wants the pretty icon.