This project is archived and is in readonly mode.
submit_tag emits extra semicolon when no onclick options are provided
Reported by scott stewart | June 11th, 2008 @ 01:33 PM
The submit_tag in form_tag_helper allows for an 'onclick' option to be bassed as one of the options hash items. Currently, if there is no 'onclick' item in the options hash then the submit_tag includes an extra semicolon in the generated onclick string.
This is caused by the .join(';') on the array of options when one of the options ('onclick') in this case, is nil.
This patch removes nil items from the options array before calling .join(';').
So, if you use this in your view:
submit_tag("Save", :disable_with => "Saving...")
Before the patch, the output looks like this:
After the patch, the output looks like this:
Notice the extra semicolon in the before patch output around this area:
this.disabled=true;this.value='Saving...;';*;*result =
Comments and changes to this ticket
-
Repository July 2nd, 2008 @ 02:43 AM
- State changed from new to resolved
- Tag set to actionpack, helper, patch, tests
(from [7378e237342443addb1691795ac9457250b6db1e]) Ensure proper output when submit_tag is used with :disabled_with. [#388 state:resolved]
Signed-off-by: Pratik Naik
-
Repository July 2nd, 2008 @ 02:43 AM
(from [67d5ac93556dd62fe6d7721a154085f39c919035]) Ensure proper output when submit_tag is used with :disabled_with. [#388 state:resolved]
Signed-off-by: Pratik Naik
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>