Skip to content
Browse files

Merge pull request #8256 from nalwayaabhishek/master

Displaying error message if validation fail in examples (p tag was missing)
  • Loading branch information...
2 parents 12d32dd + c33e893 commit ea0056f52ab8e15668326458077a3f88825d2a30 @carlosantoniodasilva carlosantoniodasilva committed Nov 19, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 activemodel/examples/validations.rb
View
6 activemodel/examples/validations.rb
@@ -22,8 +22,8 @@ def persisted?
end
person1 = Person.new
-p person1.valid?
-person1.errors
+p person1.valid? # => false
+p person1.errors.messages # => {:name=>["can't be blank"]}
person2 = Person.new(:name => "matz")
-p person2.valid?
+p person2.valid? # => true

0 comments on commit ea0056f

Please sign in to comment.
Something went wrong with that request. Please try again.