[英]before_filter: is it possible to specify controller for action?
我的application_controller中有以下字符串:
before_filter :login_required, :only => [ :edit, :update, :show, :index ]
但是對於:show,我需要在異常中放置{:controller =>'users',:action =>'show'}。 有可能嗎?
選項:
在UsersController中使用skip_before_filter
skip_before_filter :login_required, :only => :show
如果特殊情況增加,則將before_filter單獨應用於每個控制器。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.