From 51a1af96d4d21ae5fe2cabfb6e9a4754c7da012a Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 3 Sep 2005 07:43:15 +0000 Subject: Added note about how pre-packaged error functionality can be easier to recreate yourself than attempt to overly tailor #1489 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2112 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_view/helpers/active_record_helper.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'actionpack/lib/action_view/helpers/active_record_helper.rb') diff --git a/actionpack/lib/action_view/helpers/active_record_helper.rb b/actionpack/lib/action_view/helpers/active_record_helper.rb index c6d5e6019d..a8e78873bb 100644 --- a/actionpack/lib/action_view/helpers/active_record_helper.rb +++ b/actionpack/lib/action_view/helpers/active_record_helper.rb @@ -96,6 +96,10 @@ module ActionView # * header_tag - Used for the header of the error div (default: h2) # * id - The id of the error div (default: errorExplanation) # * class - The class of the error div (default: errorExplanation) + # + # NOTE: This is a pre-packaged presentation of the errors with embedded strings and a certain HTML structure. If what + # you need is significantly different from the default presentation, it makes plenty of sense to access the object.errors + # instance yourself and set it up. View the source of this method to see how easy it is. def error_messages_for(object_name, options = {}) options = options.symbolize_keys object = instance_variable_get("@#{object_name}") -- cgit v1.2.3