aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorJaime Iniesta <jaimeiniesta@gmail.com>2010-05-24 19:00:37 +0200
committerJaime Iniesta <jaimeiniesta@gmail.com>2010-05-24 19:00:37 +0200
commit844b195292f14a96806852510bf67eb67a13c919 (patch)
treec8857a6448323437e2089e4a8f4296fe77645903 /railties
parentd85b3ef3c1b0aa658babf3f3d200586dfd5c4147 (diff)
downloadrails-844b195292f14a96806852510bf67eb67a13c919.tar.gz
rails-844b195292f14a96806852510bf67eb67a13c919.tar.bz2
rails-844b195292f14a96806852510bf67eb67a13c919.zip
Fixed XHTML on activerecord_validation_callbacks guide
Diffstat (limited to 'railties')
-rw-r--r--railties/guides/source/activerecord_validations_callbacks.textile7
1 files changed, 4 insertions, 3 deletions
diff --git a/railties/guides/source/activerecord_validations_callbacks.textile b/railties/guides/source/activerecord_validations_callbacks.textile
index ee30f3963b..857551c9d5 100644
--- a/railties/guides/source/activerecord_validations_callbacks.textile
+++ b/railties/guides/source/activerecord_validations_callbacks.textile
@@ -139,7 +139,7 @@ end
+invalid?+ is simply the inverse of +valid?+. +invalid?+ triggers your validations and returns true if any errors were added to the object, and false otherwise.
-h4. +errors[]+
+h4(#validations_overview-errors). +errors[]+
To verify whether or not a particular attribute of an object is valid, you can use +errors[:attribute]+ that returns an array with all attribute errors, when there are no errors on the specified attribute, an empty array is returned.
@@ -597,7 +597,7 @@ In addition to the +valid?+ and +invalid?+ methods covered earlier, Rails provid
The following is a list of the most commonly used methods. Please refer to the +ActiveRecord::Errors+ documentation for a list of all the available methods.
-h4. +errors+
+h4(#working_with_validation_errors-errors). +errors+
Returns an OrderedHash with all errors. Each key is the attribute name and value is an array of strings with all errors.
@@ -617,7 +617,7 @@ person.valid? # => true
person.errors # => []
</ruby>
-h4. +errors[]+
+h4(#working_with_validation_errors-errors-2). +errors[]+
+errors[]+ is used when you want to check the error messages for a specific attribute. It returns an array of strings with all error messages for the given attribute, each string with one error message. If there are no errors related to the attribute returns an empty array.
@@ -1162,6 +1162,7 @@ h3. Changelog
"Lighthouse ticket":http://rails.lighthouseapp.com/projects/16213/tickets/26-active-record-validations-and-callbacks
+* May 24, 2010: Fixed document to validate XHTML 1.0 Strict. "Jaime Iniesta":http://jaimeiniesta.com
* May 15, 2010: Validation Errors section updated by "Emili ParreƱo":http://www.eparreno.com
* March 7, 2009: Callbacks revision by Trevor Turk
* February 10, 2009: Observers revision by Trevor Turk