Skip to content

Commit 1535f32

Browse files
authored
Merge pull request #1738 from mhw/bootstrap-5
Update install generator for Bootstrap 5
2 parents 3238067 + e268f95 commit 1535f32

File tree

3 files changed

+130
-194
lines changed

3 files changed

+130
-194
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,17 @@ Run the generator:
6666
rails generate simple_form:install
6767
```
6868

69-
### Bootstrap
69+
### Bootstrap 5
7070

71-
**Simple Form** can be easily integrated to the [Bootstrap](http://getbootstrap.com/).
72-
To do that you have to use the `bootstrap` option in the install generator, like this:
71+
**Simple Form** can be easily integrated with [Bootstrap 5](http://getbootstrap.com/).
72+
Use the `bootstrap` option in the install generator, like this:
7373

7474
```console
7575
rails generate simple_form:install --bootstrap
7676
```
7777

78+
This will add an initializer that configures **Simple Form** wrappers for
79+
Bootstrap 5's [form controls](https://getbootstrap.com/docs/5.0/forms/overview/).
7880
You have to be sure that you added a copy of the [Bootstrap](http://getbootstrap.com/)
7981
assets on your application.
8082

lib/generators/simple_form/install_generator.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ class InstallGenerator < Rails::Generators::Base
55
desc "Copy SimpleForm default files"
66
source_root File.expand_path('../templates', __FILE__)
77
class_option :template_engine, desc: 'Template engine to be invoked (erb, haml or slim).'
8-
class_option :bootstrap, type: :boolean, desc: 'Add the Bootstrap wrappers to the SimpleForm initializer.'
8+
class_option :bootstrap, type: :boolean, desc: 'Add the Bootstrap 5 wrappers to the SimpleForm initializer.'
99
class_option :foundation, type: :boolean, desc: 'Add the Zurb Foundation 5 wrappers to the SimpleForm initializer.'
1010

1111
def info_bootstrap
1212
return if options.bootstrap? || options.foundation?
13-
puts "SimpleForm 3 supports Bootstrap and Zurb Foundation 5. If you want "\
13+
puts "SimpleForm supports Bootstrap 5 and Zurb Foundation 5. If you want "\
1414
"a configuration that is compatible with one of these frameworks, then please " \
1515
"re-run this generator with --bootstrap or --foundation as an option."
1616
end

0 commit comments

Comments
 (0)