# Error\_message\_on broken?

**URL:** <https://www.ruby-forum.com/t/error-message-on-broken/81025>\
**Category:** Rails\
**Created:** [January 3, 2007, 4:59am UTC](https://www.ruby-forum.com/t/error-message-on-broken/81025 "2007-01-03T04:59:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ingoweiss](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/77aa72/32.png) [@ingoweiss](https://www.ruby-forum.com/u/ingoweiss)\
**Post date:** [January 3, 2007, 4:59am UTC](https://www.ruby-forum.com/t/error-message-on-broken/81025/1 "2007-01-03T04:59:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ingoweiss](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/77aa72/32.png) [@ingoweiss](https://www.ruby-forum.com/u/ingoweiss)\
**Post date:** [January 4, 2007, 12:42pm UTC](https://www.ruby-forum.com/t/error-message-on-broken/81025/2 "2007-01-04T12:42:30Z")

</div>

I’m getting this on 5813 as well ☹

On 1/3/07, Ingo W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> generates the following error:
> 
> >

–  
Dan S.  
www.peoplehub.com.au  
[www.dansketcher.com](http://www.dansketcher.com)

---

<div class="post-metadata">

**Author:** ![ingoweiss](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/77aa72/32.png) [@ingoweiss](https://www.ruby-forum.com/u/ingoweiss)\
**Post date:** [January 11, 2007, 12:08pm UTC](https://www.ruby-forum.com/t/error-message-on-broken/81025/3 "2007-01-11T12:08:49Z")

</div>

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
