我试图在仪表板上显示特定模型(没有后端表),但无法做到。
Rails Admin Code不会拾取它,也不会在仪表板上显示。
我已经定义了Railsadmin初始化文件中的模型配置。
请建议这里可能缺少什么。
预先感谢。
如果您尝试使用没有表格的模型,则可以做到这一点:
class YourModelName
include ActiveModel::Model
...
# Your code goes here, make sure you leave the persisted? method
def persisted?
false
end
end
阅读https://github.com/railsadminteam/rails_admin/issues/1377目前尚不支持ActiveModel。2012年已经有一些尝试,但没有实现。