Hi when validation fails it says the standard field name + message. Is there a way to change the field name that is displayed without changing the name of the column in the database and all other references to it? Regards Clare -- 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 -~----------~----~----~----~------~----~------~--~---
On 30 Aug 2006, at 11:36, Clare wrote:> > Hi when validation fails it says the standard field name + message. Is > there a way to change the field name that is displayed without > changing > the name of the column in the database and all other references to it? > Regards > ClareHi Clare, I''m having to do something similar but will have to write my own "error_messages_for" method. You''ll probably have to do the same. You can just copy the error_messages_for method code and re-write it to suit, then stick it in a library perhaps. Unless anyone has any better suggestions? :) Alastair ------ Alastair Moore Standards compliant web development with Ruby On Rails, PHP and ASP www.kozmo.co.uk 07738 399038 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
This plugin may be useful: http://agilewebdevelopment.com/plugins/ enhanced_activerecord_errors -- Building an e-commerce site with Rails? http://www.agilewebdevelopment.com/rails-ecommerce On Aug 30, 2006, at 4:40 AM, Alastair Moore wrote:> > On 30 Aug 2006, at 11:36, Clare wrote: > >> >> Hi when validation fails it says the standard field name + >> message. Is >> there a way to change the field name that is displayed without >> changing >> the name of the column in the database and all other references to >> it? >> Regards >> Clare > > Hi Clare, > > I''m having to do something similar but will have to write my own > "error_messages_for" method. You''ll probably have to do the same. > You can just copy the error_messages_for method code and re-write > it to suit, then stick it in a library perhaps. > > Unless anyone has any better suggestions? :) > > Alastair > > ------ > Alastair Moore > Standards compliant web development with Ruby On Rails, PHP and ASP > www.kozmo.co.uk > 07738 399038 > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Clare wrote:> Hi when validation fails it says the standard field name + message. Is > there a way to change the field name that is displayed without changing > the name of the column in the database and all other references to it? > Regards > ClareHi Clare, take a look at http://rubyforge.org/projects/custom-err-msg/ should do what you want. -- 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 -~----------~----~----~----~------~----~------~--~---
Thank you all will look into all those options. regards c -- 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 -~----------~----~----~----~------~----~------~--~---