Is there any particular reason why error_messages_for doesn''t let you pass the object you want error messages for (in case it''s not in the instance variable)? Similarly if you do form_for :person, some_random_object do |f| f.error_messages end Then it doesn''t work because that just ends up calling error_message_for(''person'') although there is @person. This looks very easily fixable but I was wondering if there was a deeper reason to it or it was just oversight (in which case I''ll write up a patch) Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
> Is there any particular reason why error_messages_for doesn''t let you > pass the object you want error messages for (in case it''s not in the > instance variable)? > Similarly if you do > > form_for :person, some_random_object do |f| > f.error_messages > end > > Then it doesn''t work because that just ends up calling > error_message_for(''person'') although there is @person. > > This looks very easily fixable but I was wondering if there was a > deeper reason to it or it was just oversight (in which case I''ll > write up a patch)I''m not aware of any philosophical reason for that behaviour, so please send in a patch. -- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On 27 Sep 2007, at 00:00, Michael Koziarski wrote:>> Similarly if you do >> >> form_for :person, some_random_object do |f| >> f.error_messages >> end >> >> Then it doesn''t work because that just ends up calling >> error_message_for(''person'') although there is no @person. >> >> This looks very easily fixable but I was wondering if there was a >> deeper reason to it or it was just oversight (in which case I''ll >> write up a patch) > > I''m not aware of any philosophical reason for that behaviour, so > please send in a patch.I''ve created a patch at http://dev.rubyonrails.org/ticket/9699 Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Hi, There''s already an issue open for this. I''ve added a patch quite a while ago but forgot to follow up and ask for verifications. I just updated the patch to work with latest rails. http://dev.rubyonrails.org/ticket/9144 Cristi On 9/27/07, Michael Koziarski <michael@koziarski.com> wrote:> > > Is there any particular reason why error_messages_for doesn''t let you > > pass the object you want error messages for (in case it''s not in the > > instance variable)? > > Similarly if you do > > > > form_for :person, some_random_object do |f| > > f.error_messages > > end > > > > Then it doesn''t work because that just ends up calling > > error_message_for(''person'') although there is @person. > > > > This looks very easily fixable but I was wondering if there was a > > deeper reason to it or it was just oversight (in which case I''ll > > write up a patch) > > I''m not aware of any philosophical reason for that behaviour, so > please send in a patch. > > -- > Cheers > > Koz > > > >-- Cristi BALAN http://evil.che.lu/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On 9/27/07, Cristi BALAN <evil@che.lu> wrote:> > Hi, > > There''s already an issue open for this. I''ve added a patch quite a > while ago but forgot to follow up and ask for verifications. > > I just updated the patch to work with latest rails. > > http://dev.rubyonrails.org/ticket/9144 > > Cristi >Hey guys, both those patches should really include some examples for use in the rdoc. If someone could beef up the documentation, attach it to one of the patches and close the other, I''d be really grateful :). I''ll credit both submitters in the changelog to avoid any conflicts. -- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On 1 Oct 2007, at 04:40, Michael Koziarski wrote:> > Hey guys, > > both those patches should really include some examples for use in the > rdoc. If someone could beef up the documentation, attach it to one of > the patches and close the other, I''d be really grateful :). > > I''ll credit both submitters in the changelog to avoid any conflicts. > >I''ve added some examples to the patch at http://dev.rubyonrails.org/ ticket/9699. I''ve not made any changes to the form_for stuff, on the grounds that it now just works as it should (ie f.error_messages doesn''t care how you created the form builder) Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---