bootstrap_form 5.3.2 → 5.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +2 -2
- data/.gitignore +7 -1
- data/.rubocop.yml +1 -0
- data/.yarnrc +1 -1
- data/CHANGELOG.md +2 -0
- data/CONTRIBUTING.md +29 -2
- data/Dockerfile +5 -4
- data/README.md +12 -12
- data/RELEASING.md +4 -2
- data/docker-compose-system-test.yml +45 -0
- data/docker-compose.yml +1 -3
- data/gemfiles/7.1.gemfile +5 -0
- data/lib/bootstrap_form/components/labels.rb +3 -2
- data/lib/bootstrap_form/components/validation.rb +1 -1
- data/lib/bootstrap_form/form_builder.rb +4 -2
- data/lib/bootstrap_form/form_group_builder.rb +1 -1
- data/lib/bootstrap_form/helpers/bootstrap.rb +9 -6
- data/lib/bootstrap_form/inputs/base.rb +7 -0
- data/lib/bootstrap_form/inputs/rich_text_area.rb +1 -1
- data/lib/bootstrap_form/version.rb +1 -1
- data/lib/bootstrap_form.rb +7 -3
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f83f141afb358e5297da435acb97a61de05d38ba70493ce820a0679f002eab41
|
4
|
+
data.tar.gz: edf0410f0a0239f36c0ea4a779e235cc5ee494a2efa2d9ecda2875222c1ba1fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 714e076f29f7067163d28e28e373db2adb41da65d60ee41b90cdabbdd0516d337ed8353e06fad10b86138d6fcd0bc2a14ea21cf6370ef2b74e8a56e2d93052d5
|
7
|
+
data.tar.gz: edf5fa822ad030d78df3a4c7b2f702406e34d956f9a8c02c0ac034fa94589fda0d0ef2a8ff2755a5fecdb15d5c9cdf27e5fdd189d2bf9d91625189681dfcd00e
|
data/.github/workflows/ruby.yml
CHANGED
@@ -31,8 +31,8 @@ jobs:
|
|
31
31
|
strategy:
|
32
32
|
fail-fast: false
|
33
33
|
matrix:
|
34
|
-
ruby-version: [ '3.2', '3.1', '3.0' ]
|
35
|
-
gemfile: [ '7.0', '6.1', 'edge' ]
|
34
|
+
ruby-version: [ '3.2', '3.1', '3.0', 'ruby-head' ]
|
35
|
+
gemfile: [ '7.1', '7.0', '6.1', 'edge' ]
|
36
36
|
env:
|
37
37
|
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
|
38
38
|
steps:
|
data/.gitignore
CHANGED
@@ -1,8 +1,14 @@
|
|
1
|
-
.
|
1
|
+
.npm/_update-notifier-last-checked
|
2
|
+
.npm/_cacache/
|
3
|
+
.npm/_logs/
|
4
|
+
.npm/_npx
|
5
|
+
|
2
6
|
.idea
|
3
7
|
log/*.log
|
4
8
|
pkg/
|
5
9
|
demo/db/*.sqlite3
|
10
|
+
demo/db/*.sqlite3-shm
|
11
|
+
demo/db/*.sqlite3-wal
|
6
12
|
demo/doc/screenshots/**/*.diff.png
|
7
13
|
demo/log/*.log
|
8
14
|
demo/tmp/
|
data/.rubocop.yml
CHANGED
data/.yarnrc
CHANGED
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,8 @@ https://github.com/bootstrap-ruby/bootstrap_form/releases
|
|
6
6
|
|
7
7
|
## Diffs
|
8
8
|
|
9
|
+
- [5.4.0](https://github.com/bootstrap-ruby/bootstrap_form/compare/v5.3.2...v5.4.0)
|
10
|
+
[Closed issues](https://github.com/bootstrap-ruby/bootstrap_form/issues?q=closed%3A2023-09-15T21%3A00..2023-10-30T00)
|
9
11
|
- [5.3.2](https://github.com/bootstrap-ruby/bootstrap_form/compare/v5.3.1...v5.3.2)
|
10
12
|
[Closed issues](https://github.com/bootstrap-ruby/bootstrap_form/issues?q=closed%3A2023-09-15T15%3A00..2023-09-15T21%3A00)
|
11
13
|
- [5.3.1](https://github.com/bootstrap-ruby/bootstrap_form/compare/v5.3.0...v5.3.1)
|
data/CONTRIBUTING.md
CHANGED
@@ -85,13 +85,20 @@ Docker is _not_ required to work on this gem.
|
|
85
85
|
|
86
86
|
The `docker-compose` approach should link to enough of your networking configuration that you can release the gem.
|
87
87
|
However, you have to do some of the configuration yourself, because it's dependent on your host operating system.
|
88
|
+
|
89
|
+
First, build the image for whatever version of Ruby you need (typically either the earliest supported version or the latest):
|
90
|
+
|
91
|
+
```bash
|
92
|
+
RUBY_VERSION=3.2 docker-compose build
|
93
|
+
```
|
94
|
+
|
88
95
|
You can run a shell in a Docker container that pretty much should behave like a Debian distribution with:
|
89
96
|
|
90
97
|
```bash
|
91
98
|
docker-compose run --service-ports shell
|
92
99
|
```
|
93
100
|
|
94
|
-
(`--service-ports` exposes port 3000 so you can browse to the demo app on `localhost:3000`. If you just want to run a
|
101
|
+
(`--service-ports` exposes port 3000 so you can browse to the demo app on `localhost:3000`. If you just want to run a one-off command, or run the test suite, leave off the `--service-ports`.)
|
95
102
|
|
96
103
|
The following instructions work for an Ubuntu host, and will probably work for other common Linux distributions.
|
97
104
|
|
@@ -123,7 +130,27 @@ services:
|
|
123
130
|
|
124
131
|
You may have to change the `1000:1000` to the user and group IDs of your laptop. You may also have to change the `version` parameter to match the version of the `docker-compose.yml` file.
|
125
132
|
|
126
|
-
Adapting the above `docker-compose.override.yml` for MacOS should be relatively straight-forward. Windows users, I'm afraid you're on your own.
|
133
|
+
Adapting the above `docker-compose.override.yml` for MacOS should be relatively straight-forward. Windows users, I'm afraid you're on your own. If you figure this out, a PR documenting how to do it would be most welcome.
|
134
|
+
|
135
|
+
The above doesn't allow you to run the system tests. To keep the image small, it doesn't include Chrome or any other browser.
|
136
|
+
|
137
|
+
There is an experimental `docker-compose-system-test.yml` file, that runs the `bootstrap_forms` docker container along with an off-the-shelf Selenium container. To start this configuration:
|
138
|
+
|
139
|
+
```bash
|
140
|
+
RUBY_VERSION=3.2 docker-compose -f docker-compose-system-test.yml -f docker-compose.override.yml up&
|
141
|
+
RUBY_VERSION=3.2 docker-compose -f docker-compose-system-test.yml -f docker-compose.override.yml exec shell /bin/bash
|
142
|
+
```
|
143
|
+
|
144
|
+
(Sometimes, on shutdown, the Rails server PID file isn't removed, and so the above will fail. `rm demo/tmp/pids/server.pid` will fix it.)
|
145
|
+
|
146
|
+
Once in the shell:
|
147
|
+
|
148
|
+
```bash
|
149
|
+
cd demo
|
150
|
+
bundle exec rails test:system
|
151
|
+
```
|
152
|
+
|
153
|
+
Note that this system test approach is highly experimental and has some rough edges. The docker compose file and/or steps to run system tests may change. The tests currently fail, because the files with which they're being compared were generated on a Mac, but the Docker containers are running Linux.
|
127
154
|
|
128
155
|
#### Simple Dockerfile
|
129
156
|
|
data/Dockerfile
CHANGED
@@ -3,6 +3,8 @@ ARG DISTRO=bullseye
|
|
3
3
|
|
4
4
|
FROM ruby:$RUBY_VERSION-$DISTRO
|
5
5
|
|
6
|
+
ARG NODE_MAJOR=18
|
7
|
+
|
6
8
|
RUN mkdir -p /app
|
7
9
|
ENV HOME /app
|
8
10
|
WORKDIR /app
|
@@ -12,10 +14,9 @@ ENV BUNDLE_APP_CONFIG="$GEM_HOME"
|
|
12
14
|
ENV PATH ./bin:$GEM_HOME/bin:$PATH
|
13
15
|
RUN (echo 'docker'; echo 'docker') | passwd root
|
14
16
|
|
15
|
-
#
|
16
|
-
|
17
|
-
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && apt-get install -y nodejs
|
17
|
+
# Rails wants a newer version of node than we get with the Debian distro.
|
18
|
+
RUN curl -fsSL https://deb.nodesource.com/setup_$NODE_MAJOR.x | bash - && apt-get install -y nodejs
|
18
19
|
RUN corepack enable && corepack prepare yarn@stable --activate
|
19
|
-
RUN apt install -y -q
|
20
|
+
RUN apt install -y -q sqlite3
|
20
21
|
|
21
22
|
EXPOSE 3000
|
data/README.md
CHANGED
@@ -31,7 +31,7 @@ Some other nice things that `bootstrap_form` does for you are:
|
|
31
31
|
|
32
32
|
## Installation
|
33
33
|
|
34
|
-
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`:
|
34
|
+
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`:
|
35
35
|
|
36
36
|
```ruby
|
37
37
|
gem "bootstrap", "~> 5.0"
|
@@ -42,7 +42,7 @@ And follow the remaining instructions in the [official bootstrap installation gu
|
|
42
42
|
Add the `bootstrap_form` gem to your `Gemfile`:
|
43
43
|
|
44
44
|
```ruby
|
45
|
-
gem "bootstrap_form", "~> 5.
|
45
|
+
gem "bootstrap_form", "~> 5.4"
|
46
46
|
```
|
47
47
|
|
48
48
|
Then:
|
@@ -1064,7 +1064,7 @@ will be rendered as:
|
|
1064
1064
|
</div>
|
1065
1065
|
</div>
|
1066
1066
|
</trix-toolbar>
|
1067
|
-
<trix-editor aria-label="Life story" class="trix-content form-control" contenteditable="" data-blob-url-template="http://
|
1067
|
+
<trix-editor aria-label="Life story" class="trix-content form-control" contenteditable="" data-blob-url-template="http://shell:3001/rails/active_storage/blobs/redirect/:signed_id/:filename" data-direct-upload-url="http://shell:3001/rails/active_storage/direct_uploads" id="user_life_story" input="user_life_story_trix_input_user" role="textbox" toolbar="trix-toolbar-1" trix-id="1">
|
1068
1068
|
</trix-editor>
|
1069
1069
|
</div>
|
1070
1070
|
```
|
@@ -1693,7 +1693,7 @@ Generated HTML:
|
|
1693
1693
|
<form accept-charset="UTF-8" action="/address" class="new_address" id="new_address_1" method="post">
|
1694
1694
|
<div class="mb-3">
|
1695
1695
|
<label class="form-label required" for="address_user_id">User</label>
|
1696
|
-
<select class="form-select" id="address_user_id" name="address[user_id]">
|
1696
|
+
<select class="form-select" id="address_user_id" name="address[user_id]" required="required">
|
1697
1697
|
<option value="">Select a value</option>
|
1698
1698
|
<option value="">steve@example.com</option>
|
1699
1699
|
</select>
|
@@ -1726,10 +1726,10 @@ Fields can be disabled using the standard Rails form helper option.
|
|
1726
1726
|
```erb
|
1727
1727
|
<%= bootstrap_form_for @user do |f| %>
|
1728
1728
|
<div class="row g-3">
|
1729
|
-
<div class="col-auto"><%= f.email_field :email, disabled: true %></div>
|
1730
|
-
<div class="col-auto"><%= f.password_field :password, disabled: true %></div>
|
1731
|
-
<div class="col-auto"><%= f.text_area :comments, disabled: true %></div>
|
1732
|
-
<div class="col-auto"><%= f.text_field :status, disabled: true %></div>
|
1729
|
+
<div class="col-auto"><%= f.email_field :email, disabled: true, size: 18 %></div>
|
1730
|
+
<div class="col-auto"><%= f.password_field :password, disabled: true, size: 18 %></div>
|
1731
|
+
<div class="col-auto"><%= f.text_area :comments, disabled: true, rows: 2, cols: 18 %></div>
|
1732
|
+
<div class="col-auto"><%= f.text_field :status, disabled: true, size: 18 %></div>
|
1733
1733
|
<div class="col-auto"><%= f.number_field :misc, label: "Number", disabled: true %></div>
|
1734
1734
|
<div class="col-auto"><%= f.radio_button :preferences, 1, disabled: true %></div>
|
1735
1735
|
<div class="col-auto"><%= f.check_box :terms, disabled: true %></div>
|
@@ -1748,26 +1748,26 @@ Generated HTML:
|
|
1748
1748
|
<div class="col-auto">
|
1749
1749
|
<div class="mb-3">
|
1750
1750
|
<label class="form-label required" for="user_email">Email</label>
|
1751
|
-
<input class="form-control" disabled id="user_email" name="user[email]" required="required" type="email" value="steve@example.com">
|
1751
|
+
<input class="form-control" disabled id="user_email" name="user[email]" required="required" size="18" type="email" value="steve@example.com">
|
1752
1752
|
</div>
|
1753
1753
|
</div>
|
1754
1754
|
<div class="col-auto">
|
1755
1755
|
<div class="mb-3">
|
1756
1756
|
<label class="form-label" for="user_password">Password</label>
|
1757
|
-
<input class="form-control" disabled id="user_password" name="user[password]" type="password">
|
1757
|
+
<input class="form-control" disabled id="user_password" name="user[password]" size="18" type="password">
|
1758
1758
|
</div>
|
1759
1759
|
</div>
|
1760
1760
|
<div class="col-auto">
|
1761
1761
|
<div class="mb-3">
|
1762
1762
|
<label class="form-label" for="user_comments">Comments</label>
|
1763
|
-
<textarea class="form-control" disabled id="user_comments" name="user[comments]">
|
1763
|
+
<textarea class="form-control" cols="18" disabled id="user_comments" name="user[comments]" rows="2">
|
1764
1764
|
</textarea>
|
1765
1765
|
</div>
|
1766
1766
|
</div>
|
1767
1767
|
<div class="col-auto">
|
1768
1768
|
<div class="mb-3">
|
1769
1769
|
<label class="form-label" for="user_status">Status</label>
|
1770
|
-
<input class="form-control" disabled id="user_status" name="user[status]" type="text">
|
1770
|
+
<input class="form-control" disabled id="user_status" name="user[status]" size="18" type="text">
|
1771
1771
|
</div>
|
1772
1772
|
</div>
|
1773
1773
|
<div class="col-auto">
|
data/RELEASING.md
CHANGED
@@ -14,13 +14,13 @@ Follow these steps to release a new version of bootstrap_form to rubygems.org.
|
|
14
14
|
2. Update the version in `./lib/bootstrap_form/version.rb`.
|
15
15
|
3. Make sure that you have all the gems necessary for testing and releasing.
|
16
16
|
|
17
|
-
BUNDLE_GEMFILE=gemfiles/7.
|
17
|
+
BUNDLE_GEMFILE=gemfiles/7.1.gemfile bundle update
|
18
18
|
|
19
19
|
4. **Ensure the tests are passing by running the tests**
|
20
20
|
|
21
21
|
(There should be no errors or warnings.)
|
22
22
|
|
23
|
-
BUNDLE_GEMFILE=gemfiles/7.
|
23
|
+
BUNDLE_GEMFILE=gemfiles/7.1.gemfile bundle exec rake test
|
24
24
|
|
25
25
|
5. **Ensure the demo tests are passing by running**
|
26
26
|
|
@@ -29,6 +29,8 @@ Follow these steps to release a new version of bootstrap_form to rubygems.org.
|
|
29
29
|
bundle exec rake test:all
|
30
30
|
cd -
|
31
31
|
|
32
|
+
(You will have failures unless you're running on a Mac configured so the screenshots will be identical. This is something that we're hoping to fix.)
|
33
|
+
|
32
34
|
6. Update the GitHub diff links at the beginning of `CHANGELOG.md` (The pattern should be obvious when you look at them).
|
33
35
|
7. Update the installation instructions in `README.md` to use the new version.
|
34
36
|
8. Commit the CHANGELOG and version changes in a single commit; the message should be "Preparing vX.Y.Z" where `X.Y.Z` is the version being released.
|
@@ -0,0 +1,45 @@
|
|
1
|
+
version: '3.3'
|
2
|
+
|
3
|
+
services:
|
4
|
+
app: &app
|
5
|
+
build:
|
6
|
+
context: .
|
7
|
+
args:
|
8
|
+
NODE_MAJOR: "12"
|
9
|
+
YARN_VERSION: "1.22.4"
|
10
|
+
RUBY_VERSION: ${RUBY_VERSION}
|
11
|
+
image: bootstrap-form:latest-$RUBY_VERSION
|
12
|
+
tmpfs:
|
13
|
+
- /tmp
|
14
|
+
|
15
|
+
shell:
|
16
|
+
<<: *app
|
17
|
+
stdin_open: true
|
18
|
+
tty: true
|
19
|
+
volumes:
|
20
|
+
- .:/app:cached
|
21
|
+
environment:
|
22
|
+
- SSH_AUTH_SOCK=/ssh-agent
|
23
|
+
- NODE_ENV=development
|
24
|
+
- BOOTSNAP_CACHE_DIR=/usr/local/bundle/_bootsnap
|
25
|
+
- WEB_CONCURRENCY=1
|
26
|
+
- HISTFILE=/app/.bash_history
|
27
|
+
- SELENIUM_HOST=selenium
|
28
|
+
- SELENIUM_PORT=4444
|
29
|
+
- TEST_APP_HOST=shell
|
30
|
+
- TEST_APP_PORT=3001
|
31
|
+
ports:
|
32
|
+
- "3001:3001"
|
33
|
+
command: /bin/bash
|
34
|
+
|
35
|
+
selenium:
|
36
|
+
image: selenium/standalone-chrome:118.0
|
37
|
+
logging:
|
38
|
+
driver: none
|
39
|
+
stdin_open: true
|
40
|
+
tty: true
|
41
|
+
environment:
|
42
|
+
- LANG=en_CA.UTF-8
|
43
|
+
ports:
|
44
|
+
- '4444:4444'
|
45
|
+
- '5900:5900'
|
data/docker-compose.yml
CHANGED
@@ -5,8 +5,7 @@ services:
|
|
5
5
|
build:
|
6
6
|
context: .
|
7
7
|
args:
|
8
|
-
NODE_MAJOR: "
|
9
|
-
YARN_VERSION: "1.22.4"
|
8
|
+
NODE_MAJOR: "18"
|
10
9
|
RUBY_VERSION: ${RUBY_VERSION}
|
11
10
|
image: bootstrap-form:latest-$RUBY_VERSION
|
12
11
|
tmpfs:
|
@@ -23,7 +22,6 @@ services:
|
|
23
22
|
- NODE_ENV=development
|
24
23
|
- RAILS_ENV=${RAILS_ENV:-development}
|
25
24
|
- BOOTSNAP_CACHE_DIR=/usr/local/bundle/_bootsnap
|
26
|
-
- WEBPACKER_DEV_SERVER_HOST=webpacker
|
27
25
|
- WEB_CONCURRENCY=1
|
28
26
|
- HISTFILE=/app/.bash_history
|
29
27
|
ports:
|
@@ -43,10 +43,11 @@ module BootstrapForm
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def label_text(name, options)
|
46
|
+
label = options[:text] || object&.class&.try(:human_attribute_name, name)&.html_safe # rubocop:disable Rails/OutputSafety
|
46
47
|
if label_errors && error?(name)
|
47
|
-
(
|
48
|
+
(" ".html_safe + get_error_messages(name)).prepend(label)
|
48
49
|
else
|
49
|
-
|
50
|
+
label
|
50
51
|
end
|
51
52
|
end
|
52
53
|
end
|
@@ -45,6 +45,8 @@ module BootstrapForm
|
|
45
45
|
include BootstrapForm::Inputs::UrlField
|
46
46
|
include BootstrapForm::Inputs::WeekField
|
47
47
|
|
48
|
+
include ActionView::Helpers::OutputSafetyHelper
|
49
|
+
|
48
50
|
delegate :content_tag, :capture, :concat, :tag, to: :@template
|
49
51
|
|
50
52
|
def initialize(object_name, object, template, options)
|
@@ -66,8 +68,8 @@ module BootstrapForm
|
|
66
68
|
return unless options[:layout] == :inline
|
67
69
|
|
68
70
|
options[:html][:class] =
|
69
|
-
([*options[:html][:class]&.split(/\s+/)] + %w[row row-cols-auto g-3 align-items-center])
|
70
|
-
.compact.uniq
|
71
|
+
safe_join(([*options[:html][:class]&.split(/\s+/)] + %w[row row-cols-auto g-3 align-items-center])
|
72
|
+
.compact.uniq, " ")
|
71
73
|
end
|
72
74
|
|
73
75
|
def fields_for_with_bootstrap(record_name, record_object=nil, fields_options={}, &block)
|
@@ -91,7 +91,7 @@ module BootstrapForm
|
|
91
91
|
css_options = html_options || options
|
92
92
|
# Add control_class; allow it to be overridden by :control_class option
|
93
93
|
control_classes = css_options.delete(:control_class) { control_class }
|
94
|
-
css_options[:class] = [control_classes, css_options[:class]].compact
|
94
|
+
css_options[:class] = safe_join([control_classes, css_options[:class]].compact, " ")
|
95
95
|
css_options[:class] << " is-invalid" if error?(method)
|
96
96
|
css_options[:placeholder] = form_group_placeholder(options, method) if options[:label_as_placeholder]
|
97
97
|
css_options
|
@@ -1,6 +1,8 @@
|
|
1
1
|
module BootstrapForm
|
2
2
|
module Helpers
|
3
3
|
module Bootstrap
|
4
|
+
include ActionView::Helpers::OutputSafetyHelper
|
5
|
+
|
4
6
|
def alert_message(title, options={})
|
5
7
|
css = options[:class] || "alert alert-danger"
|
6
8
|
return unless object.respond_to?(:errors) && object.errors.full_messages.any?
|
@@ -31,11 +33,12 @@ module BootstrapForm
|
|
31
33
|
custom_class = options[:custom_class] || false
|
32
34
|
|
33
35
|
tag.div class: custom_class || "invalid-feedback" do
|
34
|
-
if hide_attribute_name
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
errors = if hide_attribute_name
|
37
|
+
object.errors[name]
|
38
|
+
else
|
39
|
+
object.errors.full_messages_for(name)
|
40
|
+
end
|
41
|
+
safe_join(errors, ", ")
|
39
42
|
end
|
40
43
|
end
|
41
44
|
|
@@ -93,7 +96,7 @@ module BootstrapForm
|
|
93
96
|
tags = [*options[key]].map do |item|
|
94
97
|
input_group_content(item)
|
95
98
|
end
|
96
|
-
|
99
|
+
safe_join(tags)
|
97
100
|
end
|
98
101
|
end
|
99
102
|
end
|
@@ -31,9 +31,16 @@ module BootstrapForm
|
|
31
31
|
bootstrap_alias field_name
|
32
32
|
end
|
33
33
|
|
34
|
+
# Creates the methods *_without_bootstrap and *_with_bootstrap.
|
35
|
+
#
|
36
|
+
# If your application did not include the rails gem for one of the dsl
|
37
|
+
# methods, then a name error is raised and suppressed. This can happen
|
38
|
+
# if your application does not include the actiontext dependency due to
|
39
|
+
# `rich_text_area` not being defined.
|
34
40
|
def bootstrap_alias(field_name)
|
35
41
|
alias_method "#{field_name}_without_bootstrap".to_sym, field_name
|
36
42
|
alias_method field_name, "#{field_name}_with_bootstrap".to_sym
|
43
|
+
rescue NameError # rubocop:disable Lint/SuppressedException
|
37
44
|
end
|
38
45
|
end
|
39
46
|
|
@@ -10,7 +10,7 @@ module BootstrapForm
|
|
10
10
|
def rich_text_area_with_bootstrap(name, options={})
|
11
11
|
form_group_builder(name, options) do
|
12
12
|
prepend_and_append_input(name, options) do
|
13
|
-
options[:class] = ["trix-content", options[:class]].compact
|
13
|
+
options[:class] = safe_join(["trix-content", options[:class]].compact, " ")
|
14
14
|
rich_text_area_without_bootstrap(name, options)
|
15
15
|
end
|
16
16
|
end
|
data/lib/bootstrap_form.rb
CHANGED
@@ -1,9 +1,13 @@
|
|
1
|
-
# NOTE: The rich_text_area and rich_text_area_tag helpers are defined in a file
|
2
|
-
# name and not in the usual autoload-reachable way.
|
1
|
+
# NOTE: The rich_text_area and rich_text_area_tag helpers are defined in a file
|
2
|
+
# with a different name and not in the usual autoload-reachable way.
|
3
3
|
# The following line is definitely need to make `bootstrap_form` work.
|
4
|
-
|
4
|
+
# rubocop:disable Lint/SuppressedException
|
5
|
+
begin
|
5
6
|
require "#{Gem::Specification.find_by_name('actiontext').gem_dir}/app/helpers/action_text/tag_helper"
|
7
|
+
rescue Gem::MissingSpecError
|
6
8
|
end
|
9
|
+
# rubocop:enable Lint/SuppressedException
|
10
|
+
|
7
11
|
require "action_view"
|
8
12
|
require "action_pack"
|
9
13
|
require "bootstrap_form/action_view_extensions/form_helper"
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootstrap_form
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Potenza
|
8
8
|
- Carlos Lopes
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-
|
12
|
+
date: 2023-10-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -68,9 +68,11 @@ files:
|
|
68
68
|
- UPGRADE-5.0.md
|
69
69
|
- app/assets/stylesheets/rails_bootstrap_forms.css
|
70
70
|
- bootstrap_form.gemspec
|
71
|
+
- docker-compose-system-test.yml
|
71
72
|
- docker-compose.yml
|
72
73
|
- gemfiles/6.1.gemfile
|
73
74
|
- gemfiles/7.0.gemfile
|
75
|
+
- gemfiles/7.1.gemfile
|
74
76
|
- gemfiles/common.gemfile
|
75
77
|
- gemfiles/edge.gemfile
|
76
78
|
- lib/bootstrap_form.rb
|
@@ -128,7 +130,7 @@ licenses:
|
|
128
130
|
- MIT
|
129
131
|
metadata:
|
130
132
|
rubygems_mfa_required: 'true'
|
131
|
-
post_install_message:
|
133
|
+
post_install_message:
|
132
134
|
rdoc_options: []
|
133
135
|
require_paths:
|
134
136
|
- lib
|
@@ -143,8 +145,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
145
|
- !ruby/object:Gem::Version
|
144
146
|
version: '0'
|
145
147
|
requirements: []
|
146
|
-
rubygems_version: 3.4.
|
147
|
-
signing_key:
|
148
|
+
rubygems_version: 3.4.1
|
149
|
+
signing_key:
|
148
150
|
specification_version: 4
|
149
151
|
summary: Rails form builder that makes it easy to style forms using Bootstrap 5
|
150
152
|
test_files: []
|