8000 Be able to customize Tag resource form by mgrunberg · Pull Request #8448 · activeadmin/activeadmin · GitHub
[go: up one dir, main page]

Skip to content

Be able to customize Tag resource form #8448

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

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

mgrunberg
Copy link
Contributor
@mgrunberg mgrunberg commented Aug 23, 2024

#8439 improved form attributes rendering but introduced an issue if host app has an admin for Tag resource.

The following code (generated by our template app) raise errors

# admin/tags.rb
ActiveAdmin.register Tag do
  form do |f|
    f.inputs "Details" do
      f.input :name
    end
    f.actions
  end
end

The problem is that tag (tag.attributes) evaluates to the resource and not the TagHelper.

The default form works because it's rendered in a different scope (view context?).

The problem surfaced during backport development: #8446.

Let's prefix the call with helpers.

8000
#8439 improved form
attributes rendering but introduced an issue if host app has an admin
for Tag resource.

The problem is that `tag` (`tag.attributes`) refences the resource and
not the `TagHelper`.

Let's prefix the call with `helpers`.
Copy link
codecov bot commented Aug 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.11%. Comparing base (b2de8d6) to head (591bf14).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8448   +/-   ##
=======================================
  Coverage   99.11%   99.11%           
=======================================
  Files         141      141           
  Lines        4064     4066    +2     
=======================================
+ Hits         4028     4030    +2     
  Misses         36       36           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@amiel
Copy link
Contributor
amiel commented Aug 23, 2024

Apologies and thank you!

@javierjulio
Copy link
Member

@amiel not your fault and no need to apologize. This has happened before with Arbre so not surprising. @mgrunberg thank you again for addressing in both version tracks.

Copy link
Member
@javierjulio javierjulio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mgrunberg mgrunberg merged commit 54ac8f6 into master Aug 23, 2024
25 checks passed
@mgrunberg mgrunberg deleted the be-able-to-customize-tag-resource-form branch August 23, 2024 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0