控制活动管理编辑页面上的字段顺序

发布于 12-14 01:56 字数 403 浏览 3 评论 0原文

如何控制字段在活动管理编辑页面上显示的顺序?为了自定义视图页面,我更新了管理/模型文件:

ActiveAdmin.register Church do
  menu :priority => 2
  scope :inactive
  scope :unregistered
  scope :active
  scope :registered

  show do
    attributes_table :name, :address1, :address2, :city, :state, :zip, :office_phone,
                 :fax, :email1, :active, :registered
  end

但是,将“显示”更改为“编辑”或“新建”会导致无方法错误。

How can I control the order in which fields appear on an active admin edit page? To customize the View page, I've updated admin/model file with:

ActiveAdmin.register Church do
  menu :priority => 2
  scope :inactive
  scope :unregistered
  scope :active
  scope :registered

  show do
    attributes_table :name, :address1, :address2, :city, :state, :zip, :office_phone,
                 :fax, :email1, :active, :registered
  end

However, changing "show" to "edit" or "new" results in a no-method error.

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

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

发布评论

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

评论(1

计㈡愣2024-12-21 01:56:27

只需更改 attributes_table 中项目的顺序,ActiveAdmin 将使用该顺序进行显示。

更新:对于编辑页面...

form do |f|
  f.inputs "Label" do
    f.input :name
    f.input :address1
    # etc
  end
end

Just change the order of the items in your attributes_table and ActiveAdmin will use that order to display.

update: for the edit page...

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