Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10290 (closed enhancement: wontfix)

Opened 2 years ago

Last modified 2 years ago

[PATCH] Add a reset_tag method in form_tag_helper

Reported by: aledonne Assigned to: core
Priority: normal Milestone: 2.x
Component: ActionPack Version: edge
Severity: normal Keywords:
Cc:

Description

Form tag helper seems to be missing a helper for a reset button. This patch adds it.

Attachments

new_reset_tag_form_tag_helper.diff (1.9 kB) - added by aledonne on 11/26/07 21:20:10.

Change History

11/26/07 20:49:43 changed by aledonne

  • type changed from defect to enhancement.
  • component changed from ActiveRecord to ActionPack.

11/26/07 21:11:31 changed by lifofifo

Probably you don't need to call .stringify_keys twice on options hash :)

11/26/07 21:20:10 changed by aledonne

  • attachment new_reset_tag_form_tag_helper.diff added.

11/26/07 21:23:08 changed by aledonne

Updated the patch. Copy/paste from submit_tag led to the double stringify. (You know, looking at submit_tag, the second stringify is unneeded there as well, as the only intervening operation is adding a key that is explicitly a string.)

11/26/07 21:42:06 changed by jarkko

-1

Rails is all about guiding the users to best practices, and in the vast majority of forms using a reset button is very bad practice: http://www.useit.com/alertbox/20000416.html

11/26/07 21:59:30 changed by danger

-1 The patch itself is excellently done - especially the documentation - but I'm with jarkko in keeping this out of Rails core. I haven't used a reset button in some time and the useit.com article linked above makes a solid case.

Good work though, I hope to see more patches from you!

11/26/07 23:00:12 changed by josh

Its a -1 from me for the same reasons as above.

11/28/07 17:25:01 changed by aledonne

  • status changed from new to closed.
  • resolution set to wontfix.

OK; I'll cede to the usability concerns here. I can always use submit_tag :type=> 'reset' if I need a reset button, right? :) Marking "wontfix".

11/28/07 17:46:07 changed by jarkko

aledonne: You can always create your own helper for it and put it in app/helpers/application.rb. That way you'll be able to reuse it in your app. If you need it in multiple apps, you can even make a simple plugin out of it.