摘要:
rails3下,替换为 prohibited this post from being saved: 阅读全文
阅读排行榜
Rails 3 validates验证器
2013-07-13 02:21 by 张小萌, 190 阅读, 收藏,
摘要:
之前:def validate if baggage >flight.baggage_allowance errors.add_to_base("You have too much baggage")endif flight.seats.size >= flight.capacity errors.add_to_base("The flight is fully booked")endendendRails 3:validate :baggage_does_not_exceed_baggage_capacity, :seats_availab 阅读全文
sqlite shell
2013-08-06 00:39 by 张小萌, 150 阅读, 收藏,
摘要:
shell中,输入sqlite3 xxx.sqlite3,然后输入sql语句,用分号结束。退出使用.exit. 阅读全文
Rails一些命令的变化
2013-07-03 01:54 by 张小萌, 149 阅读, 收藏,
摘要:
rails generateorrails g替代了script/generaterails server orrails s 替代了script/serverrails 2 ->3路由变化:map.connect '/ads/:id', :controller=>'ads', action=>'show'变更为match '/ads/:id' => 'ads#show',:via => :get 或者get '/ads/:id' => 'ads#show 阅读全文
浙公网安备 33010602011771号