2006-10-30
Passing Parameters to before_filter
I've just noticed that before_filter can absorb a block in order to
pass parameters to pre-executed actions. Here's an example:
However, in such case, action authorized must be public, while in the tradtional way,
the action can be in any visibility. I wonder why...
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...
发表评论
- 浏览: 327617 次
- 性别:

- 来自: Montreal

- 详细资料
搜索本博客
我的相册
20059805856241
共 10 张
共 10 张
最新评论
-
Darcs简介
good 3x
-- by 夜鸣猪 -
Pratical Ocaml作者采访
现在主要用F#分析数据,因为比较舒服(人懒啊)。其实也只用到很少的FP特性,Ru ...
-- by cookoo -
Pratical Ocaml作者采访
一年多了,呵呵,cookoo能说说看,学习使用OCaml的进展和体会吗?
-- by billgui -
Memory - 柿岛伸次
还不错啊。
-- by hazzy -
Memory - 柿岛伸次
我很想下这个,可就是不能下。LZ能否提供链接
-- by yeshucheng






评论排行榜