Jonas Gauffin wrote:>> I''ve tried <%= error_messages_for ''interception_codes'' %> but nothing is >> displayed. >> > > Sorry. I mean that I tried with <%= error_messages_for ''hvd_codes'' %> > >IIRC error_messages_for simply looks for a global variable named after its parameter and parse the result ''errors'' called on it. So if you have a @hvdcode which is a HvdCode instance, just use ''hvdcode''. If you had a @foo instance of HvdCode, you''d use ''foo''... Lionel. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I have a database table called "hvd_codes", the model is called HvdCode. In my form partial, what should I enter as a parameter to error_messages_for? I''ve tried <%= error_messages_for ''interception_codes'' %> but nothing is displayed. -- 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 -~----------~----~----~----~------~----~------~--~---
> I''ve tried <%= error_messages_for ''interception_codes'' %> but nothing is > displayed.Sorry. I mean that I tried with <%= error_messages_for ''hvd_codes'' %> -- 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 -~----------~----~----~----~------~----~------~--~---
Lionel Bouton wrote:> Jonas Gauffin wrote: >>> I''ve tried <%= error_messages_for ''interception_codes'' %> but nothing is >>> displayed. >>> >> >> Sorry. I mean that I tried with <%= error_messages_for ''hvd_codes'' %> >> >> > > IIRC error_messages_for simply looks for a global variable named after > its parameter and parse the result ''errors'' called on it. > So if you have a @hvdcode which is a HvdCode instance, just use > ''hvdcode''. If you had a @foo instance of HvdCode, you''d use ''foo''... > > Lionel.Ok. It works. Thank you. -- 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 -~----------~----~----~----~------~----~------~--~---