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

Multiple Wrapper Mappings #1751

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

braindeaf
Copy link

Allow usage of wrapper_mapping sets whilst maintaining backwards
compatible config as per issue/suggestion
#1632

@braindeaf
Copy link
Author

We've been using my fork in production for just over a year now :)

@ldonnet
Copy link

ldonnet commented Jan 12, 2023

It could be so helpful if this PR could be merged because it could be very useful in many use cases. On my side, I want to migrate from bootstrap to tailwind with specific simple form wrappers and this PR permits to improve gem uses.
@braindeaf Thanks for your work and explanations!

@ldonnet
Copy link

ldonnet commented Oct 27, 2023

@braindeaf Have you continue improvements like integrated wrapper_mapping in form ?

config.wrappers :my_special_form do |b|
  b.wrapper_mapping :my_special_mapping
  b.use :input
  # ...
end

config.wrapper_mappings[:my_special_mapping] = {
  boolean: :my_special_boolean,
  # ....
}

Then when using the form in the view like this it would know which form wrapper to use and also automatically which mapping to use for this wrapper:

simple_form_for(animal, wrapper: :my_special_form)

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

Successfully merging this pull request may close these issues.

2 participants