-
Notifications
You must be signed in to change notification settings - Fork 101
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
Use field specific wrappers #81
base: main
Are you sure you want to change the base?
Use field specific wrappers #81
Conversation
I think we can ignore the codeclimate offences |
d463fb0
to
1d5da93
Compare
Please rebase on the current master, this PR is not clean If you have troubles in rebase, let me know Short-not-tested rebase guide
Follow on screen instructions, then:
After the rebase, I should not see anymore the following commits in this PR: |
1d5da93
to
00950a5
Compare
ok, rebased |
@MichalRemis thanks! Now it looks good |
…y CSV Javascript form builder for adding/removing of error messages. Before CSV used only form-wide wrapper but field may use custom wrapper specified: - by field's `wrapper` attribute - by field's type and `wrapper_mappings` attribute - by field's type and SimpleForm config `wrapper_mappings`
00950a5
to
3996907
Compare
@@ -22,6 +22,8 @@ def input(attribute_name, options = {}, &block) | |||
options.delete(:validate) | |||
end | |||
|
|||
add_field_specific_wrapper_name_to_field_options(attribute_name, options, &block) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving this to the parent gem will not be straightforward. I think I should add the method call to all the overrides
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree
Implemented field's specific wrapper_names to be passed to and used by CSV JS FormBuilder for adding/removing of error messages. Before CSV used only form-wide wrapper but SimpleForm's field may use custom wrapper specified:
wrapper
attributewrapper_mappings
attributeSimpleForm.config.wrapper_mappings
I think this feature will be also required for implementation of validating of radios/dates/etc.
I am passing wrapper_name by input's
data-simple-form-wrapper
attribute. Was thinking about putting it into CSV Hash, but I think it would require CSV code change and this is SimpleForm's thing anyway.