-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for Rails 5.1
form_with
(#369)
* 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
- Loading branch information
1 parent
4c8c178
commit c2090f5
Showing
7 changed files
with
138 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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