Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arbre duplicates form fields when inspecting model during production/debug #4639

Closed
gbisheimer opened this issue Sep 20, 2016 · 2 comments
Closed

Comments

@gbisheimer
Copy link

gbisheimer commented Sep 20, 2016

Description

I came across this problem when building this activeadmin addon aiming to customize default ActiveAdmin layout by using CaptureHelper methods.

I'm getting repeated form fields when inspecting or evaluating arbre components related to forms. I didn't had problems with anything else but forms. Seems related to Arbre but couldn't find the bug yet.

Versions

activeadmin 1.0.0.pre4
rails 5.0.0.1.
ruby 2.3.0p0

Steps to reproduce

Take any ActiveAdmin resource that has a form declaration in its DSL and add a puts self.inspect before closing the block. You will get the form fields duplicated.

Example

I'll use the default admin_user Resource as an example:

ActiveAdmin.register AdminUser do
  permit_params :email, :password, :password_confirmation

  index do
    selectable_column
    id_column
    column :email
    column :current_sign_in_at
    column :sign_in_count
    column :created_at
    actions
  end

  filter :email
  filter :current_sign_in_at
  filter :sign_in_count
  filter :created_at

  form do |f|
    f.inputs "Admin Details" do
      f.input :email
      f.input :password
      f.input :password_confirmation
    end
    f.actions
    puts self.inspect
  end

end

Go to the edit or new route and you will get something like this:

image

@gbisheimer gbisheimer changed the title Duplicated form fields when inspecting model during debug Arbre duplicates form fields when inspecting model during production/debug Sep 20, 2016
@timoschilling
Copy link
Member

Thats a Arbre issue not a ActiveAdmin one

@gbisheimer
Copy link
Author

That's correct, but it affects Active Admin as it is a required dependency. I will move the issue to Arbre repository. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants