-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from shivam091/0.6.1
0.6.1
- Loading branch information
Showing
63 changed files
with
1,599 additions
and
316 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,4 @@ demo/log/** | |
demo/tmp/**/* | ||
demo/*.byebug_history | ||
demo/public/assets | ||
demo/config/database.yml |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,114 @@ | ||
## [Unreleased] | ||
# Change Log | ||
|
||
You can find recent releases with docs in GitHub: | ||
|
||
https://github.com/shivam091/rails_bootstrap_form/releases | ||
|
||
## [0.6.1](https://github.com/shivam091/rails_bootstrap_form/compare/v0.6.0...v0.6.1) - 2023-05-24 | ||
|
||
### What's changed | ||
- Changes in directory structure | ||
- Added test cases | ||
- Added README and CHANGELOG | ||
|
||
## [0.6.0](https://github.com/shivam091/rails_bootstrap_form/compare/v0.5.3...v0.6.0) - 2023-05-22 | ||
|
||
### What's new | ||
- Added support for **`horizontal`** form layout | ||
|
||
## [0.5.3](https://github.com/shivam091/rails_bootstrap_form/compare/v0.5.2...v0.5.3) - 2023-05-21 | ||
|
||
### What's changed | ||
- Added new option inline to render checkboxes and radio buttons inline | ||
|
||
## [0.5.2](https://github.com/shivam091/rails_bootstrap_form/compare/v0.5.1...v0.5.2) - 2023-05-21 | ||
|
||
### What's new | ||
- Added option to add custom options to the field's wrapper | ||
- Added option to apply user defined CSS class to the field | ||
- Added option to control size of input group and field | ||
- Added provision to change id of the field and corresponding label | ||
|
||
### What's changed | ||
- Added `mb-3` css class to field wrapper if radio buttons or check boxes are not inline | ||
|
||
## [0.5.1](https://github.com/shivam091/rails_bootstrap_form/compare/v0.5.0...v0.5.1) - 2023-05-20 | ||
|
||
### What's new | ||
- Wrapped `collection_check_boxes` and `collection_radio_buttons` inside field wrapper. | ||
|
||
## [0.5.0](https://github.com/shivam091/rails_bootstrap_form/compare/v0.4.2...v0.5.0) - 2023-05-20 | ||
|
||
### What's new | ||
- Added wrapper methods for `check_box`, `collection_check_boxes`, `radio_button`, and `collection_radio_buttons` to support Bootstrap 5 form styles | ||
|
||
### What's changed | ||
- Replaced HTML tag of help_text component from `<span>` to `<div>` | ||
|
||
## [0.4.2](https://github.com/shivam091/rails_bootstrap_form/compare/v0.4.1...v0.4.2) - 2023-05-16 | ||
|
||
### What's new | ||
- Added wrapper method for `grouped_collection_select` | ||
|
||
## [0.4.1](https://github.com/shivam091/rails_bootstrap_form/compare/v0.4.0...v0.4.1) - 2023-05-16 | ||
|
||
## [0.1.0] - 2023-05-15 | ||
### What's fixed | ||
- Replaced `reverse_merge` by `deep_merge!` in adding new option values to fix bug causing not to merge options. | ||
|
||
## [0.4.0](https://github.com/shivam091/rails_bootstrap_form/compare/v0.3.1...v0.4.0) - 2023-05-15 | ||
|
||
### What's new | ||
- Added wrapper methods for `range_field` and `color_field` | ||
- Added wrapper methods for `time_zone_select` and `hidden_field` | ||
- Added wrapper methods for `date_select`, `time_select`, and `datetime_select` | ||
- Added wrapper method to render static control | ||
- Added wrapper method for `collection_select` | ||
|
||
## [0.3.1](https://github.com/shivam091/rails_bootstrap_form/compare/v0.3.0...v0.3.1) - 2023-05-15 | ||
|
||
### What's fixed | ||
- Bug causing fields to wrap in input group even when content to append and prepend is not available. | ||
|
||
## [0.3.0](https://github.com/shivam091/rails_bootstrap_form/compare/v0.2.3...v0.3.0) - 2023-05-15 | ||
|
||
### What's new | ||
- Added support to wrap field in input group | ||
- Added support to display error messages below the field | ||
- Added support for floating labels for inputs. | ||
|
||
## [0.2.3](https://github.com/shivam091/rails_bootstrap_form/compare/v0.2.2...v0.2.3) - 2023-05-15 | ||
|
||
### What's new | ||
- Added component to mark labels as required | ||
|
||
## [0.2.2](https://github.com/shivam091/rails_bootstrap_form/compare/v0.2.1...v0.2.2) - 2023-05-15 | ||
|
||
### What's new | ||
- Added support to display labels along with the field. | ||
|
||
## [0.2.1](https://github.com/shivam091/rails_bootstrap_form/compare/v0.2.0...v0.2.1) - 2023-05-15 | ||
|
||
### What's new | ||
- Added FieldWrapperBuilder to create wrapper for placing fields and other related components | ||
- Added support to display help text along with the field | ||
- Added wrapper methods for simple form fields | ||
|
||
## [0.2.0](https://github.com/shivam091/rails_bootstrap_form/compare/v0.1.1...v0.2.0) - 2023-05-15 | ||
|
||
### What's new | ||
- Added PORO class `BootstrapFormOptions` to maintain gem specific configuration. | ||
- Added BoostrapFormBuilder and extension methods for Rails form builder. | ||
- Added required models, controllers, and views in demo application. | ||
|
||
## [0.1.1](https://github.com/shivam091/rails_bootstrap_form/compare/v0.1.0...v0.1.1) - 2023-05-15 | ||
|
||
### What's new | ||
- Initialized demo application for demonstrating the working. | ||
- Added generater to copy initializer file required for maintaining global configuration. | ||
- Added Configuration class to maintain configurable options. | ||
|
||
## 0.1.0 - 2023-05-15 | ||
|
||
- Initial release | ||
|
||
## [Unreleased] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# RailsBootstrapForm | ||
|
||
**rails_bootstrap_form** is a Rails form builder that makes it super easy to integrate | ||
[Bootstrap 5](https://getbootstrap.com/) forms into your Rails application. | ||
|
||
## Minimum Requirements | ||
|
||
* Ruby 3.2.2+ (https://www.ruby-lang.org/en/downloads/branches/) | ||
* Rails 7.0+ (https://guides.rubyonrails.org/maintenance_policy.html) | ||
* Bootstrap 5.0+ (https://getbootstrap.com/docs/versions/) | ||
|
||
## Installation | ||
|
||
Install Bootstrap 5. There are many ways to do this, depending on the asset pipeline you're using in your Rails application. One way is to use the gem that works with Sprockets. To do so, in a brand new Rails 7.0 application created _without_ the `--webpacker` option, add the `bootstrap` gem to your `Gemfile`: | ||
|
||
```ruby | ||
gem "bootstrap", "~> 5.0" | ||
``` | ||
|
||
And follow the remaining instructions in the [official bootstrap installation guide](https://github.com/twbs/bootstrap-rubygem#a-ruby-on-rails) for setting up `application.scss` and `application.js`. | ||
|
||
Add the `rails_bootstrap_form` gem to your `Gemfile`: | ||
|
||
```ruby | ||
gem "rails_bootstrap_form", "~> 0.6.1" | ||
``` | ||
|
||
Then: | ||
|
||
`bundle install` | ||
|
||
Depending on which CSS pre-processor you are using, adding the bootstrap form styles differs slightly. | ||
If you use Rails in the default mode without any pre-processor, you'll have to add the following line to your `application.css` file: | ||
|
||
```css | ||
*= require rails_bootstrap_form | ||
``` | ||
|
||
If you followed the [official bootstrap installation guide](https://github.com/twbs/bootstrap-rubygem#a-ruby-on-rails), you'll probably have switched to SCSS. In this case add the following line to your `application.scss`: | ||
|
||
```scss | ||
@import "rails_bootstrap_form"; | ||
``` | ||
|
||
## Configuration | ||
|
||
`rails_bootstrap_form` can be used without any configuration. However, `rails_bootstrap_form` does have an optional configuration file at `config/initializers/rails_bootstrap_form.rb` for setting options that affect all generated forms in an application. This configuration file is created using the generator | ||
by running the command on the terminal. | ||
|
||
``` | ||
$ rails generate rails_bootstrap_form:install | ||
``` | ||
|
||
Example: | ||
|
||
```ruby | ||
# config/initializers/rails_bootstrap_form.rb | ||
RailsBootstrapForm.configure do |config| | ||
# to make forms non-compliant with W3C. | ||
config.default_form_attributes = {role: "form", novalidate: true} | ||
end | ||
``` | ||
|
||
The current configuration options are: | ||
|
||
| Option | Default value | Description | | ||
|---------------------------|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| `default_form_attributes` | | Set this option to `{role: "form"}` to make forms non-compliant with W3C, but generate the `role="form"` attribute. | |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,17 @@ | ||
# SQLite. Versions 3.8.0 and up are supported. | ||
# gem install sqlite3 | ||
# | ||
# Ensure the SQLite 3 gem is defined in your Gemfile | ||
# gem "sqlite3" | ||
# | ||
default: &default | ||
adapter: sqlite3 | ||
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> | ||
timeout: 5000 | ||
adapter: postgresql | ||
encoding: unicode | ||
reconnect: false | ||
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 20 } %> | ||
|
||
development: | ||
<<: *default | ||
database: db/development.sqlite3 | ||
url: <%= ENV["DATABASE_URL"] %> | ||
|
||
# Warning: The database defined as "test" will be erased and | ||
# re-generated from your development database when you run "rake". | ||
# Do not set this db to the same as development or production. | ||
test: | ||
<<: *default | ||
database: db/test.sqlite3 | ||
url: <%= ENV["DATABASE_URL"] %> | ||
|
||
production: | ||
<<: *default | ||
database: db/production.sqlite3 | ||
url: <%= ENV["DATABASE_URL"] %> |
Oops, something went wrong.