首页 > 解决方案 > 包括 RailsAdmin 组中的所有剩余字段

问题描述

在组块之外使用时,include_all_fields将呈现所有未在 CRUD 操作块中显式写入的剩余字段。

有没有办法include_all_fields在 RailsAdmin 组中使用该方法?或者以某种方式呈现所有剩余字段,这些字段尚未在同一 CRUD 操作块中的其他组中呈现?

例如

module DummyAdmin
  extend ActiveSupport::Concern

  included do
    rails_admin do
      edit do
        group :first_group do
          field :some_field
        end

        group :second_group do
          field :another_field
          field :yet_another_field
        end

        group :group_containing_all_other_fields do
          include_all_fields # this renders an error
          # I'm looking for some other way to render all remaining fields inside this group block
        end
      end
    end
  end
end

标签: ruby-on-railsrubyrails-admin

解决方案


推荐阅读