This project is archived and is in readonly mode.
weird behavior on error_messages_for
Reported by Daniel Lopes | December 29th, 2009 @ 07:53 PM | in 2.3.6
I'm not sure if it is a bug, but it causes a weird behavior.
In these lines
error_messages_for in Rails 2.3.5 the gsub call force you to
have a locale file with models like that:
models:
bank account:
one: "conta"
other: "contas"
Instead of
models:
bank_account:
one: "conta"
other: "contas"
And when you call something like BankAccount.human_name it will returns "Bankaccount" instead of "conta".
Comments and changes to this ticket
-
Martin Andert February 16th, 2010 @ 01:00 PM
I am experiencing the same problem. Looks as
error_messages_for
does agsub('_', ' ')
on the object name before handing it to i18n. My current workaround:de: active_record: models: back_account: "Bankkonto" back account: "Bankkonto"
So both
BankAccount.human_name
anderror_messages_for :bank_account
return the same translated model name. -
Martin Andert February 16th, 2010 @ 01:02 PM
- Tag changed from 2.3.5 to 2.3.5, error_messages_for, i18n
-
José Valim February 16th, 2010 @ 11:26 PM
- Assigned user set to José Valim
- Milestone set to 2.3.6
Could you please provide a failing test case?
-
Martin Andert February 17th, 2010 @ 01:56 PM
- Tag changed from 2.3.5, error_messages_for, i18n to 18, 2, error_messages_for
I have attached a failing test case.
-
Repository February 17th, 2010 @ 08:08 PM
(from [6227ec11f0bd10e0b987e2dc9030e57de6d46d54]) Fix error_messages_for i18n issue if object_name has underscores [#3629 status:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/6227ec11f0bd10e0b987e2dc9030e5... -
José Valim February 17th, 2010 @ 08:08 PM
- State changed from new to resolved
Awesome! Just applied.
-
Andrea Campi October 10th, 2010 @ 11:43 PM
- Tag changed from 18, 2, error_messages_for to 2, error_messages_for
- Importance changed from to Low
-
Andrea Campi October 16th, 2010 @ 11:36 PM
- Tag changed from 2, error_messages_for to 2-3-stable, error_messages_for
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>
People watching this ticket
Attachments
Referenced by
- 3629 weird behavior on error_messages_for (from [6227ec11f0bd10e0b987e2dc9030e57de6d46d54]) Fix err...