Skip to content

Nested Form Fields Rendered Twice in 1.2.0 Release #119

Closed
@macfanatic

Description

@macfanatic

After upgrading to the latest activeadmin and arbre, we realized that our nested form fields are being duplicated in our templates.

  • activeadmin 1.3.1
  • arbre 1.2.0
  • rails 5.2.3
  • ruby 2.3.6

Example form for ActiveAdmin resource:

ActiveAdmin.register Drawer do
  form do |f|
    columns do
      column do
        panel 'Payment Methods' do
          table do
            thead do
              th 'Payment Method'
              th 'Amount Processed'
              th 'Expected on Hand'
            end

            tbody do
              f.semantic_fields_for :payments do |payments|
                tr(class: cycle('odd', '')) do
                  td(class: 'hidden') { payments.input :id, as: :hidden }
                  td { payments.object.payment_method.name }
                  td { payments.object.amount_processed.format }
                  td { payments.object.amount_expected_on_hand.format }
                end
              end
            end
          end
        end
      end
    end
  end
end

We end up with the semantic_fields_for rendering double the amount of rows, a whole group and then the entire collection again a second time.

Leaving activeadmin and rails locked to the versions mentioned above, but downgrading to arbre version 1.1.1 (the previous release) fixes the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions