views:

102

answers:

1

I've problem with mongoid and model translations. When I'm trying use mongoDB on my model I haven't idea to translate attributes and model name. It's normally in *.yml files but in this time this doesn't work. Any ideas?

A: 

Try this in the yml file (config/locales/pt-BR.yml in my case):

 activemodel:
    attributes:
      [model_name]:
        [attribute1]: "[translation1]"
        [attribute2]: "[translation2]"
        [attribute3]: "[translation3]"

Worked for me, using mongoid 2.0.0.beta.17 and rails 3.0.0

Leonardo Cardoso