Browse files

displaying error message(p tag was missing) and adding output as comment

  • Loading branch information...
1 parent aff1872 commit c33e893775e1c775412553275d4c3cd16ca03d96 @nalwayaabhishek nalwayaabhishek committed Nov 18, 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 c33e893

Please sign in to comment.