This project is archived and is in readonly mode.
field_error_proc 'error_message undefined method' in rails 3.pre
Reported by Cam Caine | March 1st, 2010 @ 03:35 PM
I am trying to override the field_error_proc:
ActionView::Base.field_error_proc = Proc.new do |html,
instance|
%(#{html} #{instance.error_message})
end
but it throws this error:
ActionView::Template::Error (undefined method
error_message' for
#<ActionView::Helpers::InstanceTag:0x0000010361b798>)
Has error_message been changed/deprecated?
Comments and changes to this ticket
-
ieuser March 10th, 2010 @ 10:41 PM
it works but outputs safe html instead of the raw version
ActionView::Base.field_error_proc = Proc.new { |html_tag, instance|
"try to add raw and it doesnt like it..
-
Cam Caine March 10th, 2010 @ 11:33 PM
- Tag set to actionview
I think if you try adding .html_safe on the string output it works, but I am more concerned with getting what was instance.error_message but now errors.on is [] I dont see how to get it?
-
YoNoSoyTu March 15th, 2010 @ 06:18 PM
I have the same problem:
undefined method
error_message' for #<ActionView::Helpers::InstanceTag:0x40be40c>
Looking at the code (both Rails-3.0.0.beta and Edge in GitHub) at the bottom of active_model_helper.rb (http://github.com/rails/rails/blob/master/actionpack/lib/action_vie...) you can see that ActiveRecordInstanceTag has not that method defined.
I have prepared a patch which fixes the omission and includes a test.
-
Repository March 27th, 2010 @ 08:56 AM
- State changed from new to resolved
(from [334983eca042b5016d3d79d7ed5761b60ba871ed]) Recovers error_messages for ActiveRecordInstanceTag. [#4078 state:resolved]
Signed-off-by: wycats wycats@gmail.com
http://github.com/rails/rails/commit/334983eca042b5016d3d79d7ed5761...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Tags
Referenced by
- 4078 field_error_proc 'error_message undefined method' in rails 3.pre (from [334983eca042b5016d3d79d7ed5761b60ba871ed]) Recover...