Merge pull request #8256 from nalwayaabhishek/master

Displaying error message if validation fail in examples (p tag was missing)
This commit is contained in:
Carlos Antonio da Silva 2012-11-19 02:49:00 -08:00
commit ea0056f52a
1 changed files with 3 additions and 3 deletions

View File

@ -22,8 +22,8 @@ class Person
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