Model error message is not too helpful

Hello all,

I am struggling with an error that I’ve seen discussed in a few places.
a potential user of my app creates a new login, an error in their
form generates a very ugly message, starting like so: {{count}} errors
prohibited this {{model}} from being saved
A search of the web lead me to suspect this is an internationalization
problem, but the proposed remedy (reverting to an earlier i18n gem)
helped. The curious thing is that I only see this error in the new-user
signup form.

Any thoughts as to what I’m missing?


  • james
  • config
    – locales
    — en.yml

{{ }} … %{ }

ex: {{count}} … %{count}

Clearing up what Wesly posted, interpolation has changed from {{ … }}
%{ } in locales

IN locales files rails substituted text between {{ and }} that has
to %{ and }, if your en.yml file as sentences with {{model}} change it
%{model} so it will get properly interpolated.

Tried that. No go.

What is baffling to me is that it works once the user logs in, but not
creating a new user …

On 10 February 2011 19:41, James G. [email protected] wrote:

What is baffling to me is that it works once the user logs in, but not when
creating a new user …

What do you mean by ‘works’? Do you mean you do not get the error, or
you do get an error but the text is ok. If the former then you have
not fixed the {{…}} problem, it is just that the message is not being
generated (or displayed) for some reason.


Can someone explain this in en? Perhaps you mean en.yml should have the
error message translations … which I tried but got a passenger error
I did so. And why does all work well once the user logs in?

The error text is correct once the user logs in. All model errors are
correctly explained inside the app. But the model errors do not show
correctly if the user is at the signup screen.

Its as if the language setting isn’t set at one point, then it is set…

One more thing, the user is logging in via restful_authentication (yes I
realize its not the hot authorization at the moment)…