I've just noticed that before_filter can absorb a block in order to
pass parameters to pre-executed actions. Here's an example:

before_filter{|c| c.authorized(1)} 


However, in such case, action authorized must be public, while in the tradtional way,

before_filter :authorized


the action can be in any visibility. I wonder why...
评论
发表评论

您还没有登录,请登录后发表评论

cookoo
搜索本博客
我的相册
1e04c0dc-42a1-45a4-b392-aa82faafa7ea-thumb
20059805856241
共 10 张
存档
最新评论
评论排行榜