Hi, I''m developing a dutch ruby on rails application. So I want the error messages to be in dutch. But when I add: ":message => ''Geen wachtwoord ingevuld'' " to the user model I get this error message: " Password Geen wachtwoord ingevuld" How can I remove the fieldname from the error message? So it would say: "Geen wachtwoord ingevuld" --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
you could probably do something like validate_on_create :check_defaults def check_defaults errors.add("","dutch text") if self.password.length<5 end On 3/19/07, LeonB <leon-uqieUXqmKe0iy20DiJE0iw@public.gmane.org> wrote:> > > Hi, > > I''m developing a dutch ruby on rails application. So I want the error > messages to be in dutch. But when I add: ":message => ''Geen wachtwoord > ingevuld'' " to the user model I get this error message: > > " Password Geen wachtwoord ingevuld" > > How can I remove the fieldname from the error message? So it would > say: > > "Geen wachtwoord ingevuld" > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 19 Mar 2007, at 00:18, LeonB wrote:> I''m developing a dutch ruby on rails application. So I want the error > messages to be in dutch. But when I add: ":message => ''Geen wachtwoord > ingevuld'' " to the user model I get this error message: > > " Password Geen wachtwoord ingevuld" > > How can I remove the fieldname from the error message? So it would > say: > > "Geen wachtwoord ingevuld"http://agilewebdevelopment.com/plugins/error_messages_for Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks! Works like a charm. Maybe a bit too much for what I want. But maybe when I get to know Ruby/Rails better I''ll make one myself. On Mar 19, 9:33 am, Peter De Berdt <peter.de.be...-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org> wrote:> On 19 Mar 2007, at 00:18, LeonB wrote: > > > I''m developing a dutch ruby on rails application. So I want the error > > messages to be in dutch. But when I add: ":message => ''Geen wachtwoord > > ingevuld'' " to the user model I get this error message: > > > " Password Geen wachtwoord ingevuld" > > > How can I remove the fieldname from the error message? So it would > > say: > > > "Geen wachtwoord ingevuld" > > http://agilewebdevelopment.com/plugins/error_messages_for > > Best regards > > Peter De Berdt--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
LeonB wrote:> Hi, > > I''m developing a dutch ruby on rails application. So I want the error > messages to be in dutch. But when I add: ":message => ''Geen wachtwoord > ingevuld'' " to the user model I get this error message: > > " Password Geen wachtwoord ingevuld" > > How can I remove the fieldname from the error message? So it would > say: > > "Geen wachtwoord ingevuld"Another solution for languages thing=> You can change the return error message by editing the default_error_messages array hash. Example: ActiveRecord::Errors.default_error_messages[:taken] = "is in use" you put this line in your environment.rb file, and the error message will be used across all your models validation uniqueness :D -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---