-
Notifications
You must be signed in to change notification settings - Fork 359
Support :prepend and :append for the select helper
#327
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
|
Thanks for putting this together! Can you take a look into the test failure? |
Contributor
|
Looks good 👍 |
mattbrictson
pushed a commit
that referenced
this pull request
Jan 7, 2018
mattbrictson
pushed a commit
that referenced
this pull request
Jan 26, 2018
* has-error is now has-danger * inputs with errors should have form-control-feedback * control-label is now form-control-label * btn-default is now btn-secondary * form-horizontal is no longer a required class * input field should have form-control-danger on error * checkbox is now form-check * checkbox input should have form-check-input * non inline checkbox labels should have form-check-label * Support :prepend and :append for the `select` helper (#327) * Support :prepend and :append for the `select` helper Fixes #147 * Bootstrap 4 has renamed `control-label` to `form-control-label` * `form_with` mostly working. The main changes were around the fact that `form_with` doesn't automatically add class and id attributes in many places that the other form builders did. Added a `for:` to the label options if an ID was specified for the input element, so that the label would get the correct value for the `for` attribute. Sub-classed the form builder to override methods to make `form_with` work without the default Rails-generated DOM IDs. * Make it parse under Ruby 1.9.2 The `bootstrap_form_with` helper uses Ruby 2+ syntax. I put a test for the Rails version, so the helper is only parse if running Rails 5.1+. * Try another way to fix Ruby 1.9.2 parse problem. * Try Ruby 1.9.2 syntax yet again. * Close, but going to try keying on Rails ID generation. * Using the underlying option for id generation works. * Use fields instead of fields_for. * Finally remove FormBuilderFormWith. * Remove some unnecessary diffs. Remove confusing comment. Remove some more unnecessary diffs. * Fix select test case for :prepend, :append. * Fix test case that hadn't been converted to form_with. * Documentation tests. Rails 5.2 not tested yet. * Fix out-of-date HTML in test case. * Uncomment and fix Rails 5.1 collection_radio_button tests. * Fix README to remove false statements about 5.2. * heredoc * bootstrap_form_with_test working with 5.1 and 5.2. * Handle Rails 5.1 and 5.2+. * Use heredoc.strip. * Comments and more heredoc formatting. * Partially updated test cases. * Don't add class="" to label if no classes specified. * Intermediate check-in. * Intermediate. * Intermediate. * Intermediate. * Most of custom IDs working. * Uncomment test cases. * Resolve conflicts. * Saving work with tests red and debugging. * Commit before saving to future branch. * Delete redundant test files. * Remove puts and TODOs. * Tests passing up to Rails 5.1. * Some tests for form_with. All pass. * Documentation tested. * Update Rails 5.1 examples in documentation. * Pin minitest to exactly 5.10.1 for Rails 5.0. * Fence off one form_with test. * Add tests for fields method. Pass when they shouldn't. * Go back to using minitest 5.10.3 to do bisect. * Test only form_for in one case. The time zone text strings have an "&" in them. When it's converted to XML and then back to a string, the "&" gets lost. * Test and show that bootstrap_form fields helper not needed * Remove unwanted tests. * Feedback from review. Removed unneeded documentation. Moved `bootstrap_form_with` to after `bootstrap_form_for`. * Minimize test cases. * Fix mistaken commit of version. * Remove code per review. * Remove duplicate CHANGELOG entry
Contributor
|
@donv, was there a reason why this was only added for |
Collaborator
Author
|
No, no reason. |
lcreid
added a commit
to lcreid/rails-bootstrap-forms
that referenced
this pull request
Jun 4, 2018
* has-error is now has-danger * inputs with errors should have form-control-feedback * control-label is now form-control-label * btn-default is now btn-secondary * form-horizontal is no longer a required class * input field should have form-control-danger on error * checkbox is now form-check * checkbox input should have form-check-input * non inline checkbox labels should have form-check-label * Support :prepend and :append for the `select` helper (bootstrap-ruby#327) * Support :prepend and :append for the `select` helper Fixes bootstrap-ruby#147 * Bootstrap 4 has renamed `control-label` to `form-control-label` * `form_with` mostly working. The main changes were around the fact that `form_with` doesn't automatically add class and id attributes in many places that the other form builders did. Added a `for:` to the label options if an ID was specified for the input element, so that the label would get the correct value for the `for` attribute. Sub-classed the form builder to override methods to make `form_with` work without the default Rails-generated DOM IDs. * Make it parse under Ruby 1.9.2 The `bootstrap_form_with` helper uses Ruby 2+ syntax. I put a test for the Rails version, so the helper is only parse if running Rails 5.1+. * Try another way to fix Ruby 1.9.2 parse problem. * Try Ruby 1.9.2 syntax yet again. * Close, but going to try keying on Rails ID generation. * Using the underlying option for id generation works. * Use fields instead of fields_for. * Finally remove FormBuilderFormWith. * Remove some unnecessary diffs. Remove confusing comment. Remove some more unnecessary diffs. * Fix select test case for :prepend, :append. * Fix test case that hadn't been converted to form_with. * Documentation tests. Rails 5.2 not tested yet. * Fix out-of-date HTML in test case. * Uncomment and fix Rails 5.1 collection_radio_button tests. * Fix README to remove false statements about 5.2. * heredoc * bootstrap_form_with_test working with 5.1 and 5.2. * Handle Rails 5.1 and 5.2+. * Use heredoc.strip. * Comments and more heredoc formatting. * Partially updated test cases. * Don't add class="" to label if no classes specified. * Intermediate check-in. * Intermediate. * Intermediate. * Intermediate. * Most of custom IDs working. * Uncomment test cases. * Resolve conflicts. * Saving work with tests red and debugging. * Commit before saving to future branch. * Delete redundant test files. * Remove puts and TODOs. * Tests passing up to Rails 5.1. * Some tests for form_with. All pass. * Documentation tested. * Update Rails 5.1 examples in documentation. * Pin minitest to exactly 5.10.1 for Rails 5.0. * Fence off one form_with test. * Add tests for fields method. Pass when they shouldn't. * Go back to using minitest 5.10.3 to do bisect. * Test only form_for in one case. The time zone text strings have an "&" in them. When it's converted to XML and then back to a string, the "&" gets lost. * Test and show that bootstrap_form fields helper not needed * Remove unwanted tests. * Feedback from review. Removed unneeded documentation. Moved `bootstrap_form_with` to after `bootstrap_form_for`. * Minimize test cases. * Fix mistaken commit of version. * Remove code per review. * Remove duplicate CHANGELOG entry
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #147 for Bootstrap 4