开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜