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

This commit is contained in:
Abhishek Nalwaya 2012-11-18 12:34:36 +05:30
parent aff1872a87
commit c33e893775
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