Error_message_on broken?

Hi,

in my app, using the error_message_on form helper like this:

User name:
<%= 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

I’m getting this on 5813 as well :frowning:

On 1/3/07, Ingo W. [email protected] wrote:

generates the following error:


Dan S.
www.peoplehub.com.au
www.dansketcher.com

Ingo W. wrote:

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs