`
cookoo
  • 浏览: 651697 次
  • 性别: 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...
分享到:
评论

相关推荐

    php.ini-development

    To disable this feature set this option to empty value ;user_ini.filename = ; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds (5 minutes) ;user_ini.cache_ttl = ...

    CE中文版-启点CE过NP中文.exe

    启点CE过NP中文December 24 2018:Cheat Engine 6.8.2 Released: Here's a new version for the hollidays....Added an option to the processlist to filter out system processes Added a system...

    VB编程资源大全(英文源码 数据库)

    <END><br>42,rptparam.zip Passing parameters with data reports. I have set two parameters and passed them during run time.Open with VB6. <END><br>43,CompactRepair.zip A small application that ...

    EurekaLog_7.5.0.0_Enterprise

    4)....Fixed: Wrong passing of Boolean parameters in JSON (affects JIRA) 5)....Fixed: Wrong sorting of BugID, Count and DateTime columns in Viewer 6)....Fixed: Empty "Count" field/column is now ...

    数位板压力测试

    This specification was developed in response to a perceived need for a standardized programming inter-face to digitizing tablets, three dimensional position sensors, and other pointing devices by a ...

Global site tag (gtag.js) - Google Analytics