Model error message is not too helpful

Hello all,

I am struggling with an error that I’ve seen discussed in a few places.
When
a potential user of my app creates a new login, an error in their
sign-up
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)
hasn’t
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?

thanks

  • james
  • config
    – locales
    — en.yml

{{ }} … %{ }

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

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

IN locales files rails substituted text between {{ and }} that has
changed
to %{ and }, if your en.yml file as sentences with {{model}} change it
to
%{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
when
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.

Colin

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
when
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)…

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs