ruby on rails

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值