Keeping error messages out of the model

I know this has been discussed before on the list but I can’t seem to
find
the topics on gmane.

I’d like to display different validation error messages depending on the
context e.g. users choice of language and users choice of interface (I
have
a simple/advanced interface for my app). I’m wondering if someone has
come
up with a clean way of separating the error messages from the model (not
the
validation, just the actual error messages). Another plus to this would
be
that I don’t have to give the UI guys access to the model if they want
to
change the error messages.

The best solution I’ve come up with so far is to use numeric codes as my
error messages. These are then translated at display time by a helper
method. It works well but it’s a little hacky. Has anyone come up with a
better solution?

thanks
alan

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