bullet_train 1.7.20 → 1.7.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/field-partials/super-select.md +2 -35
- data/lib/bullet_train/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec504a7d2f778a870c7d53c43dd91a003d3e4894afbfe1932394a1446d0807a1
|
4
|
+
data.tar.gz: 94beb6da6f09888bdc2cd7c7242bc44c5688e990eacc86727bdc7a789e4ab7fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a69dc93c17f930524870ab8edd32fc33d4ea599f8713f6025822bfae31028e16f824da825a0f91ccec51666adcfee511913d2d5d859c4f24a0f998549049817
|
7
|
+
data.tar.gz: 9a01f31d8c0104a66b11a384af0ebacd080ff41c60ac37a96776230ab6c8e8c9d990a20eb1a4e0cfd3a4bca58022798b89f7008e6c4d678f038fad8182bc593d
|
@@ -1,4 +1,4 @@
|
|
1
|
-
Note: before you attempt to manually wire up a `super_select` field, note that Super Scaffolding will automatically do that for your models. See [Super Scaffolding](/docs/super-scaffolding.md) docs, section
|
1
|
+
Note: before you attempt to manually wire up a `super_select` field, note that Super Scaffolding will automatically do that for your models. See [Super Scaffolding](/docs/super-scaffolding.md), docs, section 5, for an example. And make sure Super Scaffolding doesn't automatically do what you're trying to do.
|
2
2
|
|
3
3
|
# Examples for the `super_select` Field Partial
|
4
4
|
|
@@ -133,40 +133,7 @@ All events dispatched from the `super_select` partial are [Select2's jQuery even
|
|
133
133
|
| select2:clearing | $select2:clearing |
|
134
134
|
| select2:clear | $select2:clear |
|
135
135
|
|
136
|
-
For example
|
137
|
-
|
138
|
-
<pre><code><div data-controller="dependent-form-fields">
|
139
|
-
<div data-action="$change->dependent-form-fields#updateDependentFields">
|
140
|
-
<%= render 'shared/fields/super_select', form: form, method: :category_id,
|
141
|
-
choices: Category.all.map { |category| [category.label_string, category.id] } %>
|
142
|
-
</div>
|
143
|
-
<div>
|
144
|
-
<!-- This is the dependent field that would get updated when the previous one changes -->
|
145
|
-
<%= render 'shared/fields/super_select', form: form, method: :category_id,
|
146
|
-
choices: Category.all.map { |category| [category.label_string, category.id] },
|
147
|
-
html_options: { data: { 'dependent-form-fields-target': 'dependentField' }} %>
|
148
|
-
</div>
|
149
|
-
</div></code></pre>
|
150
|
-
|
151
|
-
And this is an example of what the `dependent-form-fields` Stimulus controller would look like.
|
152
|
-
|
153
|
-
<pre><code>
|
154
|
-
// dependent_form_fields_controller.js
|
155
|
-
import { Controller } from "stimulus"
|
156
|
-
|
157
|
-
export default class extends Controller {
|
158
|
-
static targets = [ "dependentField" ]
|
159
|
-
|
160
|
-
updateDependentFields(event) {
|
161
|
-
const originalSelect2Event = event.detail.event
|
162
|
-
console.log(`catching event ${event.type}`, originalSelect2Event)
|
163
|
-
|
164
|
-
this.dependentFieldTargets.forEach((dependentField) => {
|
165
|
-
// update dependentField based on value found in originalSelect2Event.target.value
|
166
|
-
})
|
167
|
-
}
|
168
|
-
}
|
169
|
-
</code></pre>
|
136
|
+
For an example of catching the `$change` event to update a dependent field, look at the [Dynamic Forms and Dependent Fields](/docs/field-partials/dynamic-forms-dependent-fields.md) doc.
|
170
137
|
|
171
138
|
[select2]: https://select2.org
|
172
139
|
[select2_events]: https://select2.org/programmatic-control/events
|
data/lib/bullet_train/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bullet_train
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Culver
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: standard
|
@@ -448,16 +448,16 @@ dependencies:
|
|
448
448
|
name: pagy
|
449
449
|
requirement: !ruby/object:Gem::Requirement
|
450
450
|
requirements:
|
451
|
-
- - "
|
451
|
+
- - "<"
|
452
452
|
- !ruby/object:Gem::Version
|
453
|
-
version: '
|
453
|
+
version: '7'
|
454
454
|
type: :runtime
|
455
455
|
prerelease: false
|
456
456
|
version_requirements: !ruby/object:Gem::Requirement
|
457
457
|
requirements:
|
458
|
-
- - "
|
458
|
+
- - "<"
|
459
459
|
- !ruby/object:Gem::Version
|
460
|
-
version: '
|
460
|
+
version: '7'
|
461
461
|
- !ruby/object:Gem::Dependency
|
462
462
|
name: pry
|
463
463
|
requirement: !ruby/object:Gem::Requirement
|