`
cookoo
  • 浏览: 648447 次
  • 性别: Icon_minigender_1
  • 来自: Shanghai
社区版块
存档分类
最新评论

Passing Parameters to before_filter

    博客分类:
  • Ruby
阅读更多
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...
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics