Skip to content
This repository
Browse code

Merge pull request #8256 from nalwayaabhishek/master

Displaying error message if validation fail in examples (p tag was missing)
  • Loading branch information...
commit ea0056f52ab8e15668326458077a3f88825d2a30 2 parents 12d32dd + c33e893
Carlos Antonio da Silva authored November 19, 2012

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. 6  activemodel/examples/validations.rb
6  activemodel/examples/validations.rb
@@ -22,8 +22,8 @@ def persisted?
22 22
 end
23 23
 
24 24
 person1 = Person.new
25  
-p person1.valid?
26  
-person1.errors
  25
+p person1.valid? # => false
  26
+p person1.errors.messages # => {:name=>["can't be blank"]}
27 27
 
28 28
 person2 = Person.new(:name => "matz")
29  
-p person2.valid?
  29
+p person2.valid? # => true

0 notes on commit ea0056f

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