Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit c33e893775e1c775412553275d4c3cd16ca03d96 1 parent aff1872
Abhishek Nalwaya authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.