chapter 6
----------------------------------------------autotest----------------------------------------
gem 'annotate', :git => 'git://github.com/ctran/annotate_models.git'
bundle exec annotate
chapter 5
assets/
---------------------------------------------------------------------------Gemfile ---------------------------------------------
group :development do
gem 'autotest', '4.4.6'
gem 'rspec-rails', '2.9.0'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
group :production do
# gems specifically for Heroku go here
gem 'pg'
end
group :test do
gem 'rspec', '2.9.0'
gem 'webrat', '0.7.3'
gem "spork", '0.9.0'
end
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', :platform => :ruby
gem 'execjs'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
You are missing a comma after the :presence => true parameters:
--------------------------------------maximum length ------------------------------
class User < ActiveRecord::Base
attr_accessible :name, :email
email_regex = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
validates :name, :presence => true,
:length => { :maximum => 50 }
validates :email, :presense => true,
:format => { :with => email_regex },
:uniqueness => { :case_sensitive => false }
end