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

How to add stimulus controllers in forms #401

Open
troya2 opened this issue Mar 5, 2022 · 0 comments
Open

How to add stimulus controllers in forms #401

troya2 opened this issue Mar 5, 2022 · 0 comments

Comments

@troya2
Copy link

troya2 commented Mar 5, 2022

I am trying to add a stimulus controller to a form field to, for example, uncheck all or check all checkboxes in a collection_check_boxes field set.

I tried connection_check_boxes :user_ids, User.all, :id, :name, data: { controller: 'checkbox-selection' } but the data element is dropped since it's not part of the connection_check_boxes method.

Is there a way to accomplish this, or would this require a code change? If the latter, any suggestions on a way forward? I'd consider doing a PR for this as it seems generally useful for all form fields and other HTML elements provided by the DSL.

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