Rails i18n inflections for error messages -
does know how define gender attributes in model? when error messages appear can give them specific gender such as:
la dirección no puede estar en blanco ( address can't left blank) - address has female article in spanish
el usuario no puede estar en blanco ( user can't left blank) - user has masculine article in spanish
all of obiously using i18n inflections in specific rails /config/locales/language.yml file
------ ---------
please it's not duplicate because i'm not defining key_vale relationship "possible duplicate" suggest, i'm working actual attributes model when use things such as:
app/views/tablename/new.html.erb <% if @tablename.errors.any? %> <h2>los siguientes errores no permitieron que se salvara este elemento</h2> <ul> <% @tablename.errors.full_messages.each |msg| %> <li><%= msg %></li> <% end %> </ul>
i can article (based on gender) before actual message, problem can see don't have access directly attributes.
Comments
Post a Comment