Hi, in my app, using the error_message_on form helper like this: <label for="user_name">User name:</label> <%= error_message_on ''user'', :name %> <%= f.text_field :name %> generates the following error: undefined method `errors'' for :user:Symbol I am using edge revision 5813 and the simply_helpful plugin. Is there a way to fix this? Ingo -- 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''m getting this on 5813 as well :( On 1/3/07, Ingo Weiss <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hi, > > in my app, using the error_message_on form helper like this: > > > <label for="user_name">User name:</label> > <%= error_message_on ''user'', :name %> > <%= f.text_field :name %> > > generates the following error: > > undefined method `errors'' for :user:Symbol > > I am using edge revision 5813 and the simply_helpful plugin. Is there a > way to fix this? > > Ingo > > -- > Posted via http://www.ruby-forum.com/. > > > >-- Dan Sketcher www.peoplehub.com.au www.dansketcher.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 -~----------~----~----~----~------~----~------~--~---
Ingo Weiss wrote:> > Hi, > > in my app, using the error_message_on form helper like this: > > > <label for="user_name">User name:</label> > <%= error_message_on ''user'', :name %> > <%= f.text_field :name %> > > generates the following error: > > undefined method `errors'' for :user:Symbol > > I am using edge revision 5813 and the simply_helpful plugin. Is there a > way to fix this? > > Ingo >Hi, The problem is in active_record_helper.rb, in the method error_message_on replace for the old code: def error_message_on(object, method, prepend_text = "", append_text = "", css_class = "formError") #if object = instance_variable_get("@#{object}") && errors = object.errors.on(method) # content_tag("div", "#{prepend_text}#{errors.is_a?(Array) ? errors.first : errors}#{append_text}", :class => css_class) #else # '''' #end if errors = instance_variable_get("@#{object}").errors.on(method) content_tag("div", "#{prepend_text}#{errors.is_a?(Array) ? errors.first : errors}#{append_text}", :class => css_class) else '''' end end --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Seemingly Similar Threads
- Overloading error_message_on method in ActiveRecordHelper
- Re: RESOLVED: Overloading error_message_on method in ActiveRecordHelper
- Work around for problems with error_message_on
- Problem issue with belongs_tohas_one and error_message_on
- error_message_on / error_messages_for