-
Notifications
You must be signed in to change notification settings - Fork 630
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
Fieldset legend class configuration #1333
Comments
I know it is a poor substitute, but could you create your own semantic form builder and override: formtastic/lib/formtastic/helpers/fieldset_wrapper.rb Lines 51 to 57 in 60fb31e
And the same applies for fieldset/ol formtastic/lib/formtastic/helpers/fieldset_wrapper.rb Lines 24 to 49 in 60fb31e
Maybe give it a try in your app and see if that fixes the problem for you. Possibly the solution could be to make it easier to modify these methods and make them a bit cleaner. |
Thanks, this works so far! |
I'm not sure if I just could not find it or if it is indeed something that I'd consider to be a missing thing, so I though I just put it up here and see what happens.
Right now, the formtastic configurations and custom input class possibilities allow for customizing almost anything, which is great. What I am currently looking for is an option to define a default class for the fieldset/legend that is being generated.
The code above will render the following:
As my SCSS is BEM-oriented, a configurable option to give it a default class would be very nice. There are already options in the initializer for various things like
Formtastic::Helpers::FormHelper.default_form_class
. Maybe something along these lines for a default legend class would be an option? I'm not sure if this would collide with the fieldset that is generated for e.g. a checkbox collection, though.If there is already a way to modify this part, I'd happy to get a hint.
The text was updated successfully, but these errors were encountered: