This project is archived and is in readonly mode.
[Patch] Model name for default submit button value should be titleized
Reported by Ben Mills | December 18th, 2010 @ 02:24 AM
When a model name is more than one word, ex: Ticket Type, when using f.submit, the text of the submit button does not capitalize each word of the model. The text appears as Create Ticket type.
Attached is a patch to titleize the model name so that the text appears as Create Ticket Type.
Comments and changes to this ticket
-
Ben Mills December 18th, 2010 @ 02:26 AM
- no changes were found...
-
Ben Mills December 18th, 2010 @ 02:39 AM
Updated the patch to just titleize model regardless of what the conditions returns
-
Ryan Bigg December 18th, 2010 @ 03:06 AM
- Importance changed from to Low
please attach tests to this patch
-
Samuel Kadolph December 19th, 2010 @ 07:04 AM
Patch seems logical. However it is currently possible to fix this with localization.
en: activerecord: models: ticket_type: Ticket Type
-
Piotr Sarnacki December 19th, 2010 @ 09:38 AM
Samuel: Yes, but this patch is about sensible default.
I would rather say that it should be "Create ticket type" instead of "Create Ticket Type" or "Create Ticket type". Is "titleize" the convention in other places in forms?
-
salbito January 1st, 2011 @ 09:18 PM
+1 aswell Makes sense as a default avoids having to do this in localization files for every instance of this situation.
-
Dan Pickett February 9th, 2011 @ 01:34 AM
- Title changed from Model name for default submit button value should be titleized to [Patch] Model name for default submit button value should be titleized
- Tag changed from actionview, action_view, formbuilder, submit to actionview, action_view, formbuilder, patch, submit
+1 this is a much better default.
one of the patch's tests fails on master due to dropping the id on submit inputs in form_for
I've patched the regression and Ben's original authorship should be maintained.
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>