new_story GET /story/new(.:format) {:action=>"new", :controller=>"stories"}
edit_story GET /story/edit(.:format) {:action=>"edit", :controller=>"stories"}
story GET /story(.:format) {:action=>"show", :controller=>"stories"}
PUT /story(.:format) {:action=>"update", :controller=>"stories"}
DELETE /story(.:format) {:action=>"destroy", :controller=>"stories"}
POST /story(.:format) {:action=>"create", :controller=>"stories"}
在web开发中,我使用了其他技术,我只使用了GET
和POST
种方法,但Rails中有RESTful
种路由,默认情况下,PUT
和DELETE
种方法用于update
和destroy
种操作.使用PUT
和DELETE
有什么好处或需要?我认为这些方法只是做POST
的另一种方式——但为什么不坚持POST
呢?