开发者

What does makes resourceful do in a controller?

开发者 https://www.devze.com 2023-01-30 20:00 出处:网络
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 han
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

精彩评论

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