使用rails-admin时,仪表板将显示两次模型,请考虑以下屏幕截图:

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对象被显示两次并不重要,但据我所知,对象不应该被显示两次,我想解决这个问题。对这里要深入研究的内容有什么想法?
谢谢!
发布于 2017-12-03 18:20:37
最近我也遇到了同样的问题。该解决方案特别提到了config/initializers/rails_admin.rb中的模型名称
config.included_models = ["FirstModel", "SecondModel", "ThirdModel"]https://stackoverflow.com/questions/37465097
复制相似问题