Rails 3 和 ActiveAdmin。如何添加虚拟模型?

发布于 12-27 15:07 字数 105 浏览 2 评论 0原文

有没有办法添加虚拟模型?例如第二个仪表板,您可以在其中显示多个不同的资源?

我之所以这么问,是因为我需要创建一个页面,其中只有文档链接,例如客户发票、公司发票和其他模型的其他文档。

Is ther a way to add a virtual model? Something such as a second dashboard where you can display more than one different resources?

I ask because I need to create a page with nothing but links to documents, like customer invoices, corporate invoices and other documents from other models.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

醉生梦死2025-01-03 15:07:18

我知道的唯一方法是创建一些空模型:

app/models/fake.rb:

class Fake

end

然后创建生成器app/models/fake.rb:

ActiveAdmin.register Fake do
    config.comments = false
    config.clear_sidebar_sections!
    config.clear_action_items!

    collection_action :index do
        # here you can set you template
        render 'you_template', :layout => 'active_admin' 
    end
end

The only way I know is to create some empty model:

app/models/fake.rb:

class Fake

end

then create generator app/models/fake.rb:

ActiveAdmin.register Fake do
    config.comments = false
    config.clear_sidebar_sections!
    config.clear_action_items!

    collection_action :index do
        # here you can set you template
        render 'you_template', :layout => 'active_admin' 
    end
end
幼儿园老大2025-01-03 15:07:18

ActiveAdmin 主分支中的最新更改弃用了仪表板并创建了自定义页面的概念。请参阅

The last changes in the master branch of ActiveAdmin deprecates the Dashboard and creates the concept of custom pages. See this .

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文