I am following the Blog app from the RoR download site. The tutorial says enter this code to get confirmation:
class Post < ActiveRecord::Base
validates :name, :presence => true
validates :title, :presence => true,
:length => { :minimum => 5 }
end
I have this in my copy:
class Post < ActiveRecord::Base
validates :name, :presence => true,
validates :title, :presence => true,
:length => { :minimum => 5 }
end
Which, as far as I can see, is correct, however I get these error messages when the page starts up:
c:/Sites/blog/app/models/post.rb:3: syntax error, unexpected tSYMBEG, expecting kDO or '{' or '('
validates :Title, :presence => true,
^
C:/Sites/blog/app/models/post.rb:3: Can't assign to true
C:/Sites/blog/app/models/post.rb:4: syntax error, unexpected tASSOC, expecting tCOLON2 or '[' or '.'
:length => { :minimum => 5 }
Can anyone point out what I did wrong? It seems to me that the same thing.
source
share