2016-05-26 6 views
2

は、ダッシュボードには、二度のモデルが表示され、下のスクリーンショットを考慮してください。rails-adminにモデル名を複製しないようにするには?レール-Adminを使用し

image

RailsAdmin.config do |config| 

    ## == Devise == 
    config.authenticate_with do 
    warden.authenticate! scope: :user 
    end 
    config.current_user_method(&:current_user) 

    ## == Cancan == 
    # config.authorize_with :cancan 

    ## == Pundit == 
    # config.authorize_with :pundit 

    ## == PaperTrail == 
    # config.audit_with :paper_trail, 'User', 'PaperTrail::Version' # PaperTrail >= 3.0.0 

    ### More at https://github.com/sferik/rails_admin/wiki/Base-configuration 

    config.actions do 
    allowable_models = ['Lab', 'Order'] 

    dashboard do 
     only allowable_models 
    end 

    index do 
     only allowable_models 
    end 

    show do 
     only allowable_models 
    end 

    new do 
     only allowable_models 
    end 

    edit do 
     only allowable_models 
    end 

    delete do 
     only allowable_models 
    end 

    ## With an audit adapter, you can add: 
    # history_index 
    # history_show 
    end 
end 

本当に私限りのオブジェクトが2回表示されていることは問題ではなく、ありませんこの宝石を理解して、オブジェクトを2度表示しないでください。私はそれを修正したいと思います。ここに何を掘り起こすべきなのか?

ありがとうございます!

+0

あなたが管理者の初期化子あなたのレールを追加してくださいすることができます。 –

+0

@AlokSwainさんに感謝しました – John

答えて

0

私も最近同じ問題がありました。解決策は設定/初期化子/ rails_admin.rbに特異的にモデル名を言及した

config.included_models = ["FirstModel", "SecondModel", "ThirdModel"] 
関連する問題