【问题标题】:How can I add comments to a custom page in Active Admin?如何在 Active Admin 中向自定义页面添加评论?
【发布时间】:2014-07-02 05:16:06
【问题描述】:

我在我的 Rails 应用程序中使用 Active Admin,资源的默认页面有一个看起来非常有用的评论字段。我为我的资源创建了一个自定义显示页面,现在评论部分不见了。怎么加回来?

【问题讨论】:

    标签: ruby-on-rails activeadmin


    【解决方案1】:
    ActiveAdmin.register Project do
      show do
        attributes_table :name, :description
        active_admin_comments # Add this line for comment block
      end 
    end
    

    在最后的显示块中使用 active_admin_cmets。来源ActiveAdmin Source

    【讨论】:

      猜你喜欢
      • 2019-10-16
      • 2013-06-08
      • 2013-12-30
      • 2021-04-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-17
      • 2014-05-20
      相关资源
      最近更新 更多