来自rails 2,我的大多数控制器都有这些线:
verify :method => :post,:only => :create,:render => {:text => '405 HTTP POST required',:status => 405},:add_headers => {'Allow' => 'POST'} verify :method => :put,:only => :update,:render => {:text => '405 HTTP PUT required',:add_headers => {'Allow' => 'PUT'} verify :method => :delete,:only => :destroy,:render => {:text => '405 HTTP DELETE required',:add_headers => {'Allow' => 'DELETE'}
迁移到Rails 3后,我收到了弃用警告,告诉我这些已被删除.我知道我可以获得一些插件或任何仍然使用它们的东西,但我的问题是我真的需要了吗? rails 3默认是否强制执行基本方法?似乎它应该如果它没有,我总是感到恼火,不得不一遍又一遍地写这些线…