Changeset 9128
- Timestamp:
- 03/29/08 00:26:15 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/lib/action_view/helpers/active_record_helper.rb
r9126 r9128 204 204 alias_method :tag_without_error_wrapping, :tag 205 205 def tag(name, options) 206 if object.respond_to?("errors") && object.errors.respond_to?("on") && object.errors.on(@method_name) 207 # error_wrapping(tag_without_error_wrapping(name, options), object.errors.on(@method_name)) 208 tag_without_error_wrapping(name, options.merge({ "class" => options["class"] ? "#{options["class"]} errors" : 'errors' })) 206 if object.respond_to?("errors") && object.errors.respond_to?("on") 207 error_wrapping(tag_without_error_wrapping(name, options), object.errors.on(@method_name)) 209 208 else 210 209 tag_without_error_wrapping(name, options) … … 214 213 alias_method :content_tag_without_error_wrapping, :content_tag 215 214 def content_tag(name, value, options) 216 if object.respond_to?("errors") && object.errors.respond_to?("on") && object.errors.on(@method_name) 217 # error_wrapping(content_tag_without_error_wrapping(name, value, options), object.errors.on(@method_name)) 218 content_tag_without_error_wrapping(name, value, options.merge({ "class" => options["class"] ? "#{options["class"]} errors" : 'errors' })) 215 if object.respond_to?("errors") && object.errors.respond_to?("on") 216 error_wrapping(content_tag_without_error_wrapping(name, value, options), object.errors.on(@method_name)) 219 217 else 220 218 content_tag_without_error_wrapping(name, value, options)