-
Notifications
You must be signed in to change notification settings - Fork 357
Add default_layout
so we can use it for all forms
#550
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
Add default_layout
so we can use it for all forms
#550
Conversation
Move `process_options` from helper since we can not override helper. When someone wants to extend `BootstrapForm::FormBuilder` and use it in `form_with .... builder: MyFormBuilder`, before this change he could not use in this way since determination whether it is :inline :horizontal was done in helper.
Here's an example of a CHANGELOG.md entry (place it immediately under the * [#550](https://github.com/bootstrap-ruby/bootstrap_form/pull/550): Add `default_layout` so we can use it for all forms - [@duleorlovic](https://github.com/duleorlovic). Generated by 🚫 Danger |
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.
Good to hear from you again. This is a nice PR. I like your idea. It makes more sense to put the option in the builder itself, rather than the helper.
I don't understand why you had to change the test cases you had to change. If you know why, please let me know. I would think that moving the place where we set the option should require no changes to our tests. If I get some time I'll try to figure it out, unless you answer first.
As soon as we understand why the tests changed, we'll look at merging this PR.
The change in test is only about adding class So I need to change only those tests that were using If you like, I replaced those tests with newer I think it is safe to merge since this pull request will only add |
I reverted |
ef1d640
to
bc283da
Compare
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.
Sorry for the slow response. Unfortunately, I don't use this gem in my day job, so it can be a struggle at times to find time to work on it.
I played around with your PR a bit and looked at what it's doing, and I'm pretty much convinced that in fact you've found some tests that were "wrong" by my criteria. I want to do a bit more research to see when the wrong tests were introduced.
Please be patient. I will get to this soon. Thanks again for the contribution.
I am comfortable that the change in test cases introduced by the PR is in fact the way they should be. If we break any existing users' code (which I think will be in relatively few cases), I'm comfortable defending it as a fix to code that was broken. @duleorlovic I'll merge this now, but please confirm that we don't need to change any documentation (I don't think so, but please forgive me for double-checking.) |
I think example in README is enough https://github.com/bootstrap-ruby/bootstrap_form/pull/550/files#diff-04c6e90faac2675aa89e2176d2eec7d8R624 |
Move
process_options
from helper since we can not override helper.When someone wants to extend
BootstrapForm::FormBuilder
and use it inform_with .... builder: MyFormBuilder
, before this change he could notuse in this way since determination whether it is :inline :horizontal
was done in helper.