What does makes resourceful do in a controller?
make_resourceful do
actions :new, :crea开发者_如何转开发te, :show, :update
What is this doing? It makes reading a controller pretty confusing for me.
This code is stating that the actions that are handled by the controller are:
:new, :create, :show, :update
The make_resourceful construct comes from a rails plugin that provides way to DRY up the controller code.
There is a complete screencast from Ryan Bates about the same - http://railscasts.com/episodes/92-make-resourceful
This is the best resource you can find. Happy coding.
精彩评论