Rails getting started guide: validates not working for me?

Hi everyone,

im pretty new to ruby/rails and have an issue with the getting started tutorial on

The model should be extended by this:

class Post < ActiveRecord::Base   validates :name, :presence => true   validates :title, :presence => true,                     :length => { :minimum => 5} end

Now when i enter this into the console

p = Post.new(:content => "A new post")

i get this: ArgumentError: Range unspecified. Specify the :within, .......

That is not supposed to happen. Rails is 3.0.5, ruby is 1.8.7, so i dont see a problem there.... When i change validates to validate, it creates a record with empty values and saves it (thought of a typo, but obviously wasnt).

Im really confused. Does anybode have an idea?

Thanks for your help, Gerd

The code looks right.

Make sure you don't have class Post defined somewhere else (like post.last.rb).

Also, make sure you restart the console each time you make changes to the Post class.

Don't do a reload on the post class from inside the console as this doesn't work with ActiveRecord last I checked.