2012-03-21 5 views
2

プロジェクトでアクティブな管理者を使用しようとしています。このプロジェクトでは、別の宝石を使って異なるテナントを分離し、通常の認証にはhas_secure_passwordも使用します。特定の名前空間(ActiveAdmin)内でのみapplication_controller呼び出しをスキップする方法

ユーザーがアクティブな管理者(別の名前空間 - 管理者)に行くと、これらのフィルタを両方ともスキップする問題があります。

class ApplicationController < ActionController::Base 
    force_ssl 
    helper :all 
    protect_from_forgery 
    set_current_tenant_by_subdomain(:account, :subdomain) # need to skip this call when in the admin namespace 
    before_filter :require_user # need to skip this call when in the admin namespace 
end 

ありがとうございました!

答えて

3

set_current_tenant_by_subdomainbefore_filter :require_userを含むBaseControllerを作成し、管理者以外のコントローラに継承させることができますが、管理コントローラはApplicationControllerから直接継承します。それは過去に私のために働いています。

あなたが行を追加することができます設定/初期化子/ active_admin.rbで
+0

これを行いました。ご協力いただきありがとうございます! – lundie

1

config.skip_before_filter :offending_filter 

悲しいことに、これは/アプリでダッシュボードコントローラ以外のすべて...のためにあなたが

controller do 
    skip_before_filter :offending_filter 
end 

が必要なことを行いますadmin/dashboard.rb

関連する問題