bullet_train 1.7.21 → 1.7.22

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f4f2685373654c8fe8fe84423de70f52cc62f7110f388826348b6909eddbdf99
4
- data.tar.gz: 7059266b1951653f961529f05699afe0825d33951c1d41ae1764d5cc61b27c79
3
+ metadata.gz: ec504a7d2f778a870c7d53c43dd91a003d3e4894afbfe1932394a1446d0807a1
4
+ data.tar.gz: 94beb6da6f09888bdc2cd7c7242bc44c5688e990eacc86727bdc7a789e4ab7fd
5
5
  SHA512:
6
- metadata.gz: 72f9d90558c04e417f59ebc3c194dc87ec97d0c36fc87fd446fca2a87fae414a0653db916ef335aefd6f478e0c0063764d4f89dc74343f0653e688685f1fd1f3
7
- data.tar.gz: c3e5f0fc4d6ea7c54513ab626ba4ea52bd80a3a4e0eff2a345d2247ed1fc60c50461da2815517877d95ab5a6371f7cc912acdbc2b0a210fc7b1920936779a6ca
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 4, for an example. And make sure Super Scaffolding doesn't automatically do what you're trying to do.
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, the view template for catching the `$change` events in a parent `dependent-form-fields` using a Stimulus controller with a single `updateDependentFields` method would look like this:
137
-
138
- <pre><code>&lt;div data-controller="dependent-form-fields"&gt;
139
- &lt;div data-action="$change->dependent-form-fields#updateDependentFields"&gt;
140
- <%= render 'shared/fields/super_select', form: form, method: :category_id,
141
- choices: Category.all.map { |category| [category.label_string, category.id] } %>
142
- &lt;/div&gt;
143
- &lt;div&gt;
144
- &lt;!-- This is the dependent field that would get updated when the previous one changes --&gt;
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
- &lt;/div&gt;
149
- &lt;/div&gt;</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
@@ -1,3 +1,3 @@
1
1
  module BulletTrain
2
- VERSION = "1.7.21"
2
+ VERSION = "1.7.22"
3
3
  end
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.21
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-08-20 00:00:00.000000000 Z
11
+ date: 2024-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard