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

Cannot hide the select box in a has_one field #3667

Open
vpereira opened this issue Jan 9, 2024 · 0 comments
Open

Cannot hide the select box in a has_one field #3667

vpereira opened this issue Jan 9, 2024 · 0 comments

Comments

@vpereira
Copy link

vpereira commented Jan 9, 2024

Hello RailsAdminTeam!

I'm having some issues trying to remove the select box from a form for a model with a has_one present

I have two models:

Class Repository
  has_one :tag_filter

  edit do
   field :tag_filter do
     inline_edit false
     inline_add false
     formatted_value do
            bindings[:view].link_to 'Edit Tag Filter',
                                    bindings[:view].rails_admin.edit_path(:tag_filter, bindings[:object].tag_filter.try(:id))
     end
   end
  end
Class TagFilter
  belongs_to :repository

What I'm trying to achieve:

Screenshot from 2024-01-09 15-53-33

(just worked when passing a partial to the field, but then somehow I cannot trigger the modals correctly)

What I have today:

Screenshot from 2024-01-09 15-52-20

There is any solution for that? I want to avoid users mistakenly connecting their repository with a wrong tag_filter, but I'm not sure how to make it work.

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

1 participant