bootstrap_form 5.3.1 → 5.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -2
- data/CHANGELOG.md +4 -2
- data/README.md +3 -3
- data/lib/bootstrap_form/components/validation.rb +1 -3
- data/lib/bootstrap_form/form_builder.rb +1 -1
- data/lib/bootstrap_form/form_group.rb +2 -3
- data/lib/bootstrap_form/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7186ebccc43337fd8f78a3ced57a26654daf865e57493b10e29259057030830e
|
4
|
+
data.tar.gz: af0ee29e7b0fdcfb277d218038a68157fce0de44273f07921d8edcc7fd496166
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e77aebaaf5728eb933a3f57d492d10745a8867543e87f30e77e5ec922a3fe61783d6a769f1217eebee921782506b44c2e91d76a0bc71dc9e10f896be0f33dfc
|
7
|
+
data.tar.gz: bc6fde236ec6cdebd0c54633828caea0b7f578ffa8669d2d6e9b9fc9b2abce4f89fa20f5d0be5de6c96c05faee23f2459619b0b5585ec9e0d3545a607ac99e9d
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -6,10 +6,12 @@ https://github.com/bootstrap-ruby/bootstrap_form/releases
|
|
6
6
|
|
7
7
|
## Diffs
|
8
8
|
|
9
|
+
- [5.3.2](https://github.com/bootstrap-ruby/bootstrap_form/compare/v5.3.1...v5.3.2)
|
10
|
+
[Closed issues](https://github.com/bootstrap-ruby/bootstrap_form/issues?q=closed%3A2023-09-15T15%3A00..2023-09-15T21%3A00)
|
9
11
|
- [5.3.1](https://github.com/bootstrap-ruby/bootstrap_form/compare/v5.3.0...v5.3.1)
|
10
|
-
[Closed issues](https://github.com/bootstrap-ruby/bootstrap_form/issues?q=closed%3A2023-09-
|
12
|
+
[Closed issues](https://github.com/bootstrap-ruby/bootstrap_form/issues?q=closed%3A2023-09-15T13%3A00..2023-09-15T15%3A00)
|
11
13
|
- [5.3.0](https://github.com/bootstrap-ruby/bootstrap_form/compare/v5.2.3...v5.3.0)
|
12
|
-
[Closed issues](https://github.com/bootstrap-ruby/bootstrap_form/issues?q=closed%3A2023-06-18T07%3A00..2023-09-
|
14
|
+
[Closed issues](https://github.com/bootstrap-ruby/bootstrap_form/issues?q=closed%3A2023-06-18T07%3A00..2023-09-15T13%3A00)
|
13
15
|
- [5.2.2](https://github.com/bootstrap-ruby/bootstrap_form/compare/v5.2.2...v5.2.3)
|
14
16
|
[Closed issues](https://github.com/bootstrap-ruby/bootstrap_form/issues?q=closed%3A2023-05-28T16%3A00..2023-06-18T07%3A00)
|
15
17
|
- [5.2.2](https://github.com/bootstrap-ruby/bootstrap_form/compare/v5.2.1...v5.2.2)
|
data/README.md
CHANGED
@@ -1214,7 +1214,7 @@ The `label_col` and `control_col` css classes can also be changed per control:
|
|
1214
1214
|
```erb
|
1215
1215
|
<%= bootstrap_form_for(@user, layout: :horizontal) do |f| %>
|
1216
1216
|
<%= f.email_field :email %>
|
1217
|
-
<%= f.text_field :age, label_col:
|
1217
|
+
<%= f.text_field :age, label_col: %w[col-sm-3 text-bg-info], control_col: %w[col-sm-3 text-bg-success] %>
|
1218
1218
|
<%= f.check_box :terms, label_col: "", control_col: "col-sm-11" %>
|
1219
1219
|
<%= f.form_group do %>
|
1220
1220
|
<%= f.submit %>
|
@@ -1233,8 +1233,8 @@ This generates:
|
|
1233
1233
|
</div>
|
1234
1234
|
</div>
|
1235
1235
|
<div class="mb-3 row">
|
1236
|
-
<label class="col-form-label col-sm-3" for="user_age">Age</label>
|
1237
|
-
<div class="col-sm-3">
|
1236
|
+
<label class="col-form-label col-sm-3 text-bg-info" for="user_age">Age</label>
|
1237
|
+
<div class="col-sm-3 text-bg-success">
|
1238
1238
|
<input class="form-control" id="user_age" name="user[age]" type="text" value="42">
|
1239
1239
|
</div>
|
1240
1240
|
</div>
|
@@ -47,9 +47,7 @@ module BootstrapForm
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def call_with_self(object, proc)
|
50
|
-
if proc.is_a? Symbol
|
51
|
-
proc = object.method(proc)
|
52
|
-
end
|
50
|
+
proc = object.method(proc) if proc.is_a? Symbol
|
53
51
|
object.instance_exec(*[(object if proc.arity >= 1)].compact, &proc)
|
54
52
|
end
|
55
53
|
|
@@ -104,7 +104,7 @@ module BootstrapForm
|
|
104
104
|
end
|
105
105
|
|
106
106
|
def offset_col(label_col)
|
107
|
-
label_col.gsub(/\bcol-(\w+)-(\d)\b/, 'offset-\1-\2')
|
107
|
+
[*label_col].flat_map { |s| s.split(/\s+/) }.grep(/^col-/).join(" ").gsub(/\bcol-(\w+)-(\d)\b/, 'offset-\1-\2')
|
108
108
|
end
|
109
109
|
|
110
110
|
def default_control_col
|
@@ -10,9 +10,8 @@ module BootstrapForm
|
|
10
10
|
|
11
11
|
options[:class] = form_group_classes(options)
|
12
12
|
|
13
|
-
tag.div(**options.except(:append, :
|
14
|
-
:input_group_class, :label_col, :
|
15
|
-
:add_control_col_class, :layout, :prepend, :floating)) do
|
13
|
+
tag.div(**options.except(:add_control_col_class, :append, :control_col, :floating, :help, :icon, :id,
|
14
|
+
:input_group_class, :label, :label_col, :layout, :prepend)) do
|
16
15
|
label = generate_label(options[:id], name, options[:label], options[:label_col], options[:layout])
|
17
16
|
form_group_content(label, generate_help(name, options[:help]), options, &block)
|
18
17
|
end
|