compony 0.11.11 → 0.11.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rspec +2 -0
- data/CHANGELOG.md +13 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +145 -106
- data/README.md +12 -1
- data/Rakefile +10 -0
- data/TODO.md +2 -1
- data/VERSION +1 -1
- data/compony.gemspec +5 -3
- data/config/locales/es.yml +46 -0
- data/doc/ComponentGenerator.html +1 -1
- data/doc/Components.html +1 -1
- data/doc/ComponentsGenerator.html +1 -1
- data/doc/Compony/Component.html +1 -1
- data/doc/Compony/ComponentMixins/Default/Labelling.html +1 -1
- data/doc/Compony/ComponentMixins/Default/Standalone/ResourcefulVerbDsl.html +1 -1
- data/doc/Compony/ComponentMixins/Default/Standalone/StandaloneDsl.html +1 -1
- data/doc/Compony/ComponentMixins/Default/Standalone/VerbDsl.html +1 -1
- data/doc/Compony/ComponentMixins/Default/Standalone.html +1 -1
- data/doc/Compony/ComponentMixins/Default.html +1 -1
- data/doc/Compony/ComponentMixins/Resourceful.html +1 -1
- data/doc/Compony/ComponentMixins.html +1 -1
- data/doc/Compony/Components/Buttons/CssButton.html +1 -1
- data/doc/Compony/Components/Buttons/Link.html +1 -1
- data/doc/Compony/Components/Buttons.html +1 -1
- data/doc/Compony/Components/Destroy.html +1 -1
- data/doc/Compony/Components/Edit.html +1 -1
- data/doc/Compony/Components/Form.html +1 -1
- data/doc/Compony/Components/Index.html +1 -1
- data/doc/Compony/Components/List.html +1 -1
- data/doc/Compony/Components/New.html +1 -1
- data/doc/Compony/Components/Show.html +1 -1
- data/doc/Compony/Components/WithForm.html +1 -1
- data/doc/Compony/Components.html +1 -1
- data/doc/Compony/ControllerMixin.html +1 -1
- data/doc/Compony/Engine.html +1 -1
- data/doc/Compony/Intent.html +1 -1
- data/doc/Compony/ManageIntentsDsl.html +2 -2
- data/doc/Compony/MethodAccessibleHash.html +1 -1
- data/doc/Compony/ModelFields/Anchormodel.html +1 -1
- data/doc/Compony/ModelFields/Association.html +1 -1
- data/doc/Compony/ModelFields/Attachment.html +1 -1
- data/doc/Compony/ModelFields/Base.html +8 -2
- data/doc/Compony/ModelFields/Boolean.html +1 -1
- data/doc/Compony/ModelFields/Color.html +1 -1
- data/doc/Compony/ModelFields/Currency.html +1 -1
- data/doc/Compony/ModelFields/Date.html +1 -1
- data/doc/Compony/ModelFields/Datetime.html +1 -1
- data/doc/Compony/ModelFields/Decimal.html +1 -1
- data/doc/Compony/ModelFields/Email.html +1 -1
- data/doc/Compony/ModelFields/Float.html +1 -1
- data/doc/Compony/ModelFields/Integer.html +1 -1
- data/doc/Compony/ModelFields/Percentage.html +1 -1
- data/doc/Compony/ModelFields/Phone.html +1 -1
- data/doc/Compony/ModelFields/RichText.html +1 -1
- data/doc/Compony/ModelFields/String.html +1 -1
- data/doc/Compony/ModelFields/Text.html +1 -1
- data/doc/Compony/ModelFields/Time.html +1 -1
- data/doc/Compony/ModelFields/Url.html +1 -1
- data/doc/Compony/ModelFields.html +1 -1
- data/doc/Compony/ModelMixin.html +1 -1
- data/doc/Compony/NaturalOrdering.html +1 -1
- data/doc/Compony/RequestContext.html +1 -1
- data/doc/Compony/Version.html +1 -1
- data/doc/Compony/ViewHelpers.html +1 -1
- data/doc/Compony/VirtualModel.html +1 -1
- data/doc/Compony.html +1 -1
- data/doc/ComponyController.html +1 -1
- data/doc/_index.html +1 -1
- data/doc/file.CHANGELOG.html +88 -76
- data/doc/file.README.html +21 -11
- data/doc/file.basic_component.html +14 -14
- data/doc/file.cookbook.html +27 -27
- data/doc/file.destroy.html +2 -2
- data/doc/file.dsl_reference.html +199 -199
- data/doc/file.edit.html +3 -3
- data/doc/file.example.html +13 -13
- data/doc/file.example_advanced.html +10 -10
- data/doc/file.feasibility.html +2 -2
- data/doc/file.form.html +7 -7
- data/doc/file.generators.html +3 -3
- data/doc/file.glossary.html +44 -44
- data/doc/file.gotchas.html +35 -35
- data/doc/file.index.html +10 -10
- data/doc/file.inheritance.html +5 -5
- data/doc/file.installation.html +9 -9
- data/doc/file.integrations.html +46 -46
- data/doc/file.intents.html +11 -11
- data/doc/file.internal_datastructures.html +6 -6
- data/doc/file.list.html +35 -35
- data/doc/file.maintaining.html +21 -21
- data/doc/file.model_fields.html +3 -3
- data/doc/file.nesting.html +5 -5
- data/doc/file.new.html +3 -3
- data/doc/file.ownership.html +2 -2
- data/doc/file.patterns.html +50 -50
- data/doc/file.pre_built_components.html +2 -2
- data/doc/file.resourceful.html +5 -5
- data/doc/file.show.html +17 -17
- data/doc/file.standalone.html +12 -12
- data/doc/file.virtual_models.html +2 -2
- data/doc/file.with_form.html +23 -23
- data/doc/index.html +21 -11
- data/doc/top-level-namespace.html +1 -1
- data/lib/compony/model_fields/base.rb +3 -0
- data/spec/README.md +22 -0
- data/spec/compony/component_spec.rb +80 -0
- data/spec/compony/compony_spec.rb +102 -0
- data/spec/compony/intent_spec.rb +94 -0
- data/spec/compony/method_accessible_hash_spec.rb +32 -0
- data/spec/compony/model_fields_spec.rb +70 -0
- data/spec/compony/model_mixin_spec.rb +81 -0
- data/spec/compony/natural_ordering_spec.rb +61 -0
- data/spec/dummy/app/components/statics/home.rb +17 -0
- data/spec/dummy/app/components/statics/secret.rb +15 -0
- data/spec/dummy/app/components/users/destroy.rb +2 -0
- data/spec/dummy/app/components/users/edit.rb +2 -0
- data/spec/dummy/app/components/users/form.rb +14 -0
- data/spec/dummy/app/components/users/index.rb +29 -0
- data/spec/dummy/app/components/users/new.rb +2 -0
- data/spec/dummy/app/components/users/show.rb +26 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/models/ability.rb +7 -0
- data/spec/dummy/app/models/application_record.rb +4 -0
- data/spec/dummy/app/models/user.rb +22 -0
- data/spec/dummy/app/views/layouts/application.html.erb +7 -0
- data/spec/dummy/config/application.rb +20 -0
- data/spec/dummy/config/database.yml +3 -0
- data/spec/dummy/config/environment.rb +3 -0
- data/spec/dummy/config/initializers/simple_form.rb +9 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/db/schema.rb +14 -0
- data/spec/rails_helper.rb +23 -0
- data/spec/requests/authorization_spec.rb +16 -0
- data/spec/requests/plain_component_spec.rb +9 -0
- data/spec/requests/routing_spec.rb +20 -0
- data/spec/requests/users_crud_spec.rb +99 -0
- metadata +63 -1
data/doc/file.dsl_reference.html
CHANGED
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
<div id="content"><div id='filecontents'>
|
|
61
61
|
<p><a href="/README_md.html#guide--documentation">Back to the guide</a></p>
|
|
62
62
|
|
|
63
|
-
<h1 id="
|
|
63
|
+
<h1 id="dsl-reference">DSL reference</h1>
|
|
64
64
|
|
|
65
65
|
<p>Flat lookup of every Compony DSL method, its calling context, signature, and a one-line description. This page is generated from <code># DSL method</code> markers in the source — when in doubt the Ruby source under <code>lib/compony/</code> is authoritative. “Context” says where the call is legal.</p>
|
|
66
66
|
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
<p><strong>model</strong> — in an <code>ActiveRecord</code>/model class that <code>include</code>s the model mixin.</p>
|
|
82
82
|
</li></ul>
|
|
83
83
|
|
|
84
|
-
<h2 id="
|
|
84
|
+
<h2 id="component-definition">Component definition</h2>
|
|
85
85
|
|
|
86
86
|
<table role="table">
|
|
87
87
|
<thead>
|
|
@@ -94,70 +94,70 @@
|
|
|
94
94
|
</thead>
|
|
95
95
|
<tbody>
|
|
96
96
|
<tr>
|
|
97
|
-
<td
|
|
97
|
+
<td><code>setup</code></td>
|
|
98
98
|
<td>class</td>
|
|
99
|
-
<td
|
|
99
|
+
<td><code>setup { block }</code></td>
|
|
100
100
|
<td>Main config block. Runs at end of init; parent runs before child.</td>
|
|
101
101
|
</tr>
|
|
102
102
|
<tr>
|
|
103
|
-
<td
|
|
103
|
+
<td><code>label</code></td>
|
|
104
104
|
<td>setup</td>
|
|
105
|
-
<td
|
|
105
|
+
<td><code>label(:short/:long/:all) { |model| ... }</code></td>
|
|
106
106
|
<td>Component title + link/button text. Resourceful comps take 1 block arg.</td>
|
|
107
107
|
</tr>
|
|
108
108
|
<tr>
|
|
109
|
-
<td
|
|
109
|
+
<td><code>color</code></td>
|
|
110
110
|
<td>setup</td>
|
|
111
|
-
<td
|
|
111
|
+
<td><code>color { '#AA0000' }</code></td>
|
|
112
112
|
<td>Component color (not used by Compony itself).</td>
|
|
113
113
|
</tr>
|
|
114
114
|
<tr>
|
|
115
|
-
<td
|
|
115
|
+
<td><code>icon</code></td>
|
|
116
116
|
<td>setup</td>
|
|
117
|
-
<td
|
|
117
|
+
<td><code>icon { %i[fa-solid circle] }</code></td>
|
|
118
118
|
<td>Component icon (not used by Compony itself).</td>
|
|
119
119
|
</tr>
|
|
120
120
|
<tr>
|
|
121
|
-
<td
|
|
121
|
+
<td><code>content</code></td>
|
|
122
122
|
<td>setup</td>
|
|
123
|
-
<td
|
|
124
|
-
<td>Define/replace a named view block (Dyny).
|
|
123
|
+
<td><code>content(name = :main, before: nil, hidden: false) { block }</code></td>
|
|
124
|
+
<td>Define/replace a named view block (Dyny). <code>hidden: true</code> = don’t auto-render. Non-obvious use: hidden <code>:main</code> + <code>:wrapper</code> chrome → <a href="/doc/guide/patterns_md.html#1-the-app-base-component-layer">patterns §1</a>.</td>
|
|
125
125
|
</tr>
|
|
126
126
|
<tr>
|
|
127
|
-
<td
|
|
127
|
+
<td><code>content</code></td>
|
|
128
128
|
<td>content</td>
|
|
129
|
-
<td
|
|
130
|
-
<td>Render another content block of the <
|
|
129
|
+
<td><code>content(:name)</code></td>
|
|
130
|
+
<td>Render another content block of the <em>same</em> component (nesting). <a href="/doc/guide/patterns_md.html#1-the-app-base-component-layer">patterns §1</a>.</td>
|
|
131
131
|
</tr>
|
|
132
132
|
<tr>
|
|
133
|
-
<td
|
|
133
|
+
<td><code>remove_content</code></td>
|
|
134
134
|
<td>setup</td>
|
|
135
|
-
<td
|
|
135
|
+
<td><code>remove_content(:name)</code></td>
|
|
136
136
|
<td>Remove an inherited content block (returns false if absent).</td>
|
|
137
137
|
</tr>
|
|
138
138
|
<tr>
|
|
139
|
-
<td
|
|
139
|
+
<td><code>remove_content!</code></td>
|
|
140
140
|
<td>setup</td>
|
|
141
|
-
<td
|
|
141
|
+
<td><code>remove_content!(:name)</code></td>
|
|
142
142
|
<td>Same, raises if the block was not found.</td>
|
|
143
143
|
</tr>
|
|
144
144
|
<tr>
|
|
145
|
-
<td
|
|
145
|
+
<td><code>before_render</code></td>
|
|
146
146
|
<td>setup</td>
|
|
147
|
-
<td
|
|
148
|
-
<td>Pre-content hook. If it sets a response body (e.g. redirect), content is skipped. Non-obvious uses: verb-independent guard →
|
|
147
|
+
<td><code>before_render(name = :main, before: nil) { block }</code></td>
|
|
148
|
+
<td>Pre-content hook. If it sets a response body (e.g. redirect), content is skipped. Non-obvious uses: verb-independent guard → <a href="/doc/guide/patterns_md.html#8-lifecycle-hooks-for-derived-data">patterns §8</a>; wizard step nav → <a href="/doc/guide/patterns_md.html#16-multi-step-wizard-across-components">patterns §16</a>.</td>
|
|
149
149
|
</tr>
|
|
150
150
|
<tr>
|
|
151
|
-
<td
|
|
151
|
+
<td><code>exposed_intents</code></td>
|
|
152
152
|
<td>setup</td>
|
|
153
|
-
<td
|
|
154
|
-
<td>Declare intents the layout/parent renders. See
|
|
153
|
+
<td><code>exposed_intents { add ...; remove ... }</code></td>
|
|
154
|
+
<td>Declare intents the layout/parent renders. See <code>add</code>/<code>remove</code>, and the toolbar pattern → <a href="/doc/guide/patterns_md.html#9-exposed-intents-as-the-action-toolbar">patterns §9</a>.</td>
|
|
155
155
|
</tr>
|
|
156
156
|
<tr>
|
|
157
|
-
<td
|
|
157
|
+
<td><code>path</code></td>
|
|
158
158
|
<td>setup</td>
|
|
159
|
-
<td
|
|
160
|
-
<td>Override path generation for this component (advanced). Runs outside the request context — build URLs via
|
|
159
|
+
<td><code>path { |model, *args, standalone_name:, **kw| ... }</code></td>
|
|
160
|
+
<td>Override path generation for this component (advanced). Runs outside the request context — build URLs via <code>Rails.application.routes.url_helpers</code>. Non-obvious use: mint a signed token into the URL → <a href="/doc/guide/patterns_md.html#18-signed-token-capability-links-auth-less-onboarding--magic-links">patterns §18</a>; see also <a href="/doc/guide/standalone_md.html#customizing-path-generation">standalone.md</a>.</td>
|
|
161
161
|
</tr>
|
|
162
162
|
</tbody>
|
|
163
163
|
</table>
|
|
@@ -174,19 +174,19 @@
|
|
|
174
174
|
</thead>
|
|
175
175
|
<tbody>
|
|
176
176
|
<tr>
|
|
177
|
-
<td
|
|
178
|
-
<td
|
|
177
|
+
<td><code>add</code></td>
|
|
178
|
+
<td><code>add(comp, model_or_family, before: nil, **intent_opts)</code></td>
|
|
179
179
|
<td>Add/replace an exposed intent (keyed by intent name).</td>
|
|
180
180
|
</tr>
|
|
181
181
|
<tr>
|
|
182
|
-
<td
|
|
183
|
-
<td
|
|
182
|
+
<td><code>remove</code></td>
|
|
183
|
+
<td><code>remove(:intent_name)</code></td>
|
|
184
184
|
<td>Remove a previously added exposed intent.</td>
|
|
185
185
|
</tr>
|
|
186
186
|
</tbody>
|
|
187
187
|
</table>
|
|
188
188
|
|
|
189
|
-
<h2 id="
|
|
189
|
+
<h2 id="standalone-routing">Standalone (routing)</h2>
|
|
190
190
|
|
|
191
191
|
<table role="table">
|
|
192
192
|
<thead>
|
|
@@ -199,51 +199,51 @@
|
|
|
199
199
|
</thead>
|
|
200
200
|
<tbody>
|
|
201
201
|
<tr>
|
|
202
|
-
<td
|
|
202
|
+
<td><code>standalone</code></td>
|
|
203
203
|
<td>setup</td>
|
|
204
|
-
<td
|
|
205
|
-
<td>Generate a Rails route. Non-obvious use: a <
|
|
204
|
+
<td><code>standalone(name = nil, path:, constraints: nil, scope: nil, scope_args: {}) { ... }</code></td>
|
|
205
|
+
<td>Generate a Rails route. Non-obvious use: a <em>named</em> extra <code>standalone</code> for an ajax companion endpoint of the same screen → <a href="/doc/guide/patterns_md.html#17-inline-patch-without-a-form-reorder--quick-toggle">patterns §17</a>.</td>
|
|
206
206
|
</tr>
|
|
207
207
|
<tr>
|
|
208
|
-
<td
|
|
208
|
+
<td><code>verb</code></td>
|
|
209
209
|
<td>standalone</td>
|
|
210
|
-
<td
|
|
210
|
+
<td><code>verb(:get/:post/:patch/:put/:delete/...) { ... }</code></td>
|
|
211
211
|
<td>Config one HTTP verb. Up to once per verb per standalone.</td>
|
|
212
212
|
</tr>
|
|
213
213
|
<tr>
|
|
214
|
-
<td
|
|
214
|
+
<td><code>skip_authentication!</code></td>
|
|
215
215
|
<td>standalone</td>
|
|
216
|
-
<td
|
|
217
|
-
<td>Disable app authentication for this standalone (still need
|
|
216
|
+
<td><code>skip_authentication!</code></td>
|
|
217
|
+
<td>Disable app authentication for this standalone (still need <code>authorize</code>). Non-obvious use: token-gated auth-less links → <a href="/doc/guide/patterns_md.html#18-signed-token-capability-links-auth-less-onboarding--magic-links">patterns §18</a>.</td>
|
|
218
218
|
</tr>
|
|
219
219
|
<tr>
|
|
220
|
-
<td
|
|
220
|
+
<td><code>skip_forgery_protection!</code></td>
|
|
221
221
|
<td>standalone</td>
|
|
222
|
-
<td
|
|
223
|
-
<td>Disable CSRF for this standalone’s action. Non-obvious use: inbound webhooks →
|
|
222
|
+
<td><code>skip_forgery_protection!</code></td>
|
|
223
|
+
<td>Disable CSRF for this standalone’s action. Non-obvious use: inbound webhooks → <a href="/doc/guide/patterns_md.html#13-public-endpoints--webhooks">patterns §13</a>.</td>
|
|
224
224
|
</tr>
|
|
225
225
|
<tr>
|
|
226
|
-
<td
|
|
226
|
+
<td><code>layout</code></td>
|
|
227
227
|
<td>standalone</td>
|
|
228
|
-
<td
|
|
229
|
-
<td>Rails layout for this standalone. Defaults to
|
|
228
|
+
<td><code>layout('layouts/backend')</code></td>
|
|
229
|
+
<td>Rails layout for this standalone. Defaults to <code>layouts/application</code>. Centralize in the base layer → <a href="/doc/guide/patterns_md.html#1-the-app-base-component-layer">patterns §1</a>.</td>
|
|
230
230
|
</tr>
|
|
231
231
|
<tr>
|
|
232
|
-
<td
|
|
232
|
+
<td><code>authorize</code></td>
|
|
233
233
|
<td>verb</td>
|
|
234
|
-
<td
|
|
235
|
-
<td><strong>Mandatory.</strong> Truthy = access; falsy →
|
|
234
|
+
<td><code>authorize { can?(:read, @data) }</code></td>
|
|
235
|
+
<td><strong>Mandatory.</strong> Truthy = access; falsy → <code>CanCan::AccessDenied</code>. Non-obvious use: validate a signed token → <a href="/doc/guide/patterns_md.html#18-signed-token-capability-links-auth-less-onboarding--magic-links">patterns §18</a>.</td>
|
|
236
236
|
</tr>
|
|
237
237
|
<tr>
|
|
238
|
-
<td
|
|
238
|
+
<td><code>respond</code></td>
|
|
239
239
|
<td>verb</td>
|
|
240
|
-
<td
|
|
241
|
-
<td>Override the controller response (e.g. send_data, render json, redirect). Overriding
|
|
240
|
+
<td><code>respond(format = nil) { ... }</code></td>
|
|
241
|
+
<td>Override the controller response (e.g. send_data, render json, redirect). Overriding <code>nil</code> format <strong>skips <code>authorize</code></strong> — re-check yourself. Non-obvious uses: CSV/PDF export → <a href="/doc/guide/patterns_md.html#10-csv--pdf-via-respond-format">patterns §10</a>; ajax-only PATCH → <a href="/doc/guide/patterns_md.html#17-inline-patch-without-a-form-reorder--quick-toggle">patterns §17</a>.</td>
|
|
242
242
|
</tr>
|
|
243
243
|
</tbody>
|
|
244
244
|
</table>
|
|
245
245
|
|
|
246
|
-
<h2 id="
|
|
246
|
+
<h2 id="resourceful-lifecycle-hooks">Resourceful lifecycle hooks</h2>
|
|
247
247
|
|
|
248
248
|
<p>Available in <strong>setup</strong> (global, all verbs) on resourceful components; the same names also work inside a <strong>verb</strong> block to override for one path+verb.</p>
|
|
249
249
|
|
|
@@ -257,39 +257,39 @@
|
|
|
257
257
|
</thead>
|
|
258
258
|
<tbody>
|
|
259
259
|
<tr>
|
|
260
|
-
<td
|
|
261
|
-
<td
|
|
262
|
-
<td>Set/get the model class. Defaults to family name singularized+constantized. Non-obvious use: point at a
|
|
260
|
+
<td><code>data_class</code></td>
|
|
261
|
+
<td><code>data_class(NewClass = nil)</code></td>
|
|
262
|
+
<td>Set/get the model class. Defaults to family name singularized+constantized. Non-obvious use: point at a <code>VirtualModel</code> → <a href="/doc/guide/patterns_md.html#12-virtual-model-for-non-persistent--upload-forms">patterns §12</a>.</td>
|
|
263
263
|
</tr>
|
|
264
264
|
<tr>
|
|
265
|
-
<td
|
|
266
|
-
<td
|
|
267
|
-
<td>Override record loading. Default:
|
|
265
|
+
<td><code>load_data</code></td>
|
|
266
|
+
<td><code>load_data { @data = ... }</code></td>
|
|
267
|
+
<td>Override record loading. Default: <code>data_class.find(params[:id])</code>. Runs before <code>authorize</code>. Non-obvious uses: Index scope → <a href="/doc/guide/patterns_md.html#3-index--load_data-scope--nested-list">patterns §3</a>; load+dup for clone → <a href="/doc/guide/patterns_md.html#11-non-crud-job-dispatch-toggles-clone">patterns §11</a>.</td>
|
|
268
268
|
</tr>
|
|
269
269
|
<tr>
|
|
270
|
-
<td
|
|
271
|
-
<td
|
|
272
|
-
<td>Runs after
|
|
270
|
+
<td><code>after_load_data</code></td>
|
|
271
|
+
<td><code>after_load_data { ... }</code></td>
|
|
272
|
+
<td>Runs after <code>load_data</code>, before <code>authorize</code>. Refine an AR relation here.</td>
|
|
273
273
|
</tr>
|
|
274
274
|
<tr>
|
|
275
|
-
<td
|
|
276
|
-
<td
|
|
277
|
-
<td>Assign validated params onto
|
|
275
|
+
<td><code>assign_attributes</code></td>
|
|
276
|
+
<td><code>assign_attributes { ... }</code></td>
|
|
277
|
+
<td>Assign validated params onto <code>@data</code>. Pre-built forms supply a default.</td>
|
|
278
278
|
</tr>
|
|
279
279
|
<tr>
|
|
280
|
-
<td
|
|
281
|
-
<td
|
|
282
|
-
<td>After
|
|
280
|
+
<td><code>after_assign_attributes</code></td>
|
|
281
|
+
<td><code>after_assign_attributes { ... }</code></td>
|
|
282
|
+
<td>After <code>assign_attributes</code>, before <code>store_data</code>. Prefill/derive fields here → <a href="/doc/guide/patterns_md.html#8-lifecycle-hooks-for-derived-data">patterns §8</a>; seed from a token → <a href="/doc/guide/patterns_md.html#18-signed-token-capability-links-auth-less-onboarding--magic-links">patterns §18</a>.</td>
|
|
283
283
|
</tr>
|
|
284
284
|
<tr>
|
|
285
|
-
<td
|
|
286
|
-
<td
|
|
287
|
-
<td>Persist
|
|
285
|
+
<td><code>store_data</code></td>
|
|
286
|
+
<td><code>store_data { @data.save }</code></td>
|
|
287
|
+
<td>Persist <code>@data</code>. Override for virtual models / uploads → <a href="/doc/guide/patterns_md.html#12-virtual-model-for-non-persistent--upload-forms">patterns §12</a>, or to enqueue work / multi-record txn → <a href="/doc/guide/patterns_md.html#11-non-crud-job-dispatch-toggles-clone">patterns §11</a>.</td>
|
|
288
288
|
</tr>
|
|
289
289
|
</tbody>
|
|
290
290
|
</table>
|
|
291
291
|
|
|
292
|
-
<h2 id="
|
|
292
|
+
<h2 id="form-component-dsl">Form component DSL</h2>
|
|
293
293
|
|
|
294
294
|
<p><code>class Components::X::Form < Compony::Components::Form</code></p>
|
|
295
295
|
|
|
@@ -304,81 +304,81 @@
|
|
|
304
304
|
</thead>
|
|
305
305
|
<tbody>
|
|
306
306
|
<tr>
|
|
307
|
-
<td
|
|
307
|
+
<td><code>form_fields</code></td>
|
|
308
308
|
<td>setup</td>
|
|
309
|
-
<td
|
|
310
|
-
<td><strong>Mandatory.</strong> Block holding the form inputs (Dyny +
|
|
309
|
+
<td><code>form_fields { ... }</code></td>
|
|
310
|
+
<td><strong>Mandatory.</strong> Block holding the form inputs (Dyny + <code>field</code>/<code>f</code>).</td>
|
|
311
311
|
</tr>
|
|
312
312
|
<tr>
|
|
313
|
-
<td
|
|
313
|
+
<td><code>field</code></td>
|
|
314
314
|
<td>form_fields</td>
|
|
315
|
-
<td
|
|
316
|
-
<td>Render a simple_form input inferred from the model field.
|
|
315
|
+
<td><code>field(:name, multilang: false, **simple_form_opts)</code></td>
|
|
316
|
+
<td>Render a simple_form input inferred from the model field. <code>as:</code>/<code>hidden:</code> supported.</td>
|
|
317
317
|
</tr>
|
|
318
318
|
<tr>
|
|
319
|
-
<td
|
|
319
|
+
<td><code>pw_field</code></td>
|
|
320
320
|
<td>form_fields</td>
|
|
321
|
-
<td
|
|
322
|
-
<td>Password input; checks
|
|
321
|
+
<td><code>pw_field(:password, **opts)</code></td>
|
|
322
|
+
<td>Password input; checks <code>:set_password</code> ability.</td>
|
|
323
323
|
</tr>
|
|
324
324
|
<tr>
|
|
325
|
-
<td
|
|
325
|
+
<td><code>f</code></td>
|
|
326
326
|
<td>form_fields</td>
|
|
327
|
-
<td
|
|
328
|
-
<td>The underlying
|
|
327
|
+
<td><code>f</code></td>
|
|
328
|
+
<td>The underlying <code>simple_form</code> builder (for <code>f.rich_text_area</code> etc.).</td>
|
|
329
329
|
</tr>
|
|
330
330
|
<tr>
|
|
331
|
-
<td
|
|
331
|
+
<td><code>collect</code></td>
|
|
332
332
|
<td>form_fields</td>
|
|
333
|
-
<td
|
|
333
|
+
<td><code>collect(...)</code></td>
|
|
334
334
|
<td>Wrap a collection in Rails-compatible format (Anchormodel helper).</td>
|
|
335
335
|
</tr>
|
|
336
336
|
<tr>
|
|
337
|
-
<td
|
|
337
|
+
<td><code>schema_field</code></td>
|
|
338
338
|
<td>setup</td>
|
|
339
|
-
<td
|
|
340
|
-
<td>Whitelist one field in the Schemacop param schema. For associations use the
|
|
339
|
+
<td><code>schema_field(:name, multilang: false)</code></td>
|
|
340
|
+
<td>Whitelist one field in the Schemacop param schema. For associations use the <strong>association name</strong>, not <code>_id</code>.</td>
|
|
341
341
|
</tr>
|
|
342
342
|
<tr>
|
|
343
|
-
<td
|
|
343
|
+
<td><code>schema_fields</code></td>
|
|
344
344
|
<td>setup</td>
|
|
345
|
-
<td
|
|
346
|
-
<td>Mass
|
|
345
|
+
<td><code>schema_fields(:a, :b, ...)</code></td>
|
|
346
|
+
<td>Mass <code>schema_field</code>.</td>
|
|
347
347
|
</tr>
|
|
348
348
|
<tr>
|
|
349
|
-
<td
|
|
349
|
+
<td><code>schema_pw_field</code></td>
|
|
350
350
|
<td>setup</td>
|
|
351
|
-
<td
|
|
352
|
-
<td>Whitelist a password param (checks
|
|
351
|
+
<td><code>schema_pw_field(:password)</code></td>
|
|
352
|
+
<td>Whitelist a password param (checks <code>:set_password</code>).</td>
|
|
353
353
|
</tr>
|
|
354
354
|
<tr>
|
|
355
|
-
<td
|
|
355
|
+
<td><code>schema_line</code></td>
|
|
356
356
|
<td>setup</td>
|
|
357
|
-
<td
|
|
358
|
-
<td>Add a raw Schemacop3 line (nested attrs, custom shapes) →
|
|
357
|
+
<td><code>schema_line { str? :foo }</code></td>
|
|
358
|
+
<td>Add a raw Schemacop3 line (nested attrs, custom shapes) → <a href="/doc/guide/patterns_md.html#5-custom-form--schemacop-kept-in-sync">patterns §5</a>.</td>
|
|
359
359
|
</tr>
|
|
360
360
|
<tr>
|
|
361
|
-
<td
|
|
361
|
+
<td><code>schema</code></td>
|
|
362
362
|
<td>setup</td>
|
|
363
|
-
<td
|
|
363
|
+
<td><code>schema(:wrapper_key) { ... }</code></td>
|
|
364
364
|
<td>Replace the whole schema + wrapper key (fully manual).</td>
|
|
365
365
|
</tr>
|
|
366
366
|
<tr>
|
|
367
|
-
<td
|
|
367
|
+
<td><code>form_params</code></td>
|
|
368
368
|
<td>setup</td>
|
|
369
|
-
<td
|
|
370
|
-
<td>Extra kwargs passed to
|
|
369
|
+
<td><code>form_params(**opts)</code></td>
|
|
370
|
+
<td>Extra kwargs passed to <code>simple_form_for</code>.</td>
|
|
371
371
|
</tr>
|
|
372
372
|
<tr>
|
|
373
|
-
<td
|
|
373
|
+
<td><code>disable!</code></td>
|
|
374
374
|
<td>setup</td>
|
|
375
|
-
<td
|
|
375
|
+
<td><code>disable!</code></td>
|
|
376
376
|
<td>Render all inputs disabled.</td>
|
|
377
377
|
</tr>
|
|
378
378
|
<tr>
|
|
379
|
-
<td
|
|
379
|
+
<td><code>skip_autofocus</code></td>
|
|
380
380
|
<td>setup</td>
|
|
381
|
-
<td
|
|
381
|
+
<td><code>skip_autofocus</code></td>
|
|
382
382
|
<td>Don’t autofocus the first field.</td>
|
|
383
383
|
</tr>
|
|
384
384
|
</tbody>
|
|
@@ -396,54 +396,54 @@
|
|
|
396
396
|
</thead>
|
|
397
397
|
<tbody>
|
|
398
398
|
<tr>
|
|
399
|
-
<td
|
|
400
|
-
<td
|
|
401
|
-
<td>HTTP verb the form submits with (
|
|
399
|
+
<td><code>submit_verb</code></td>
|
|
400
|
+
<td><code>submit_verb(:patch)</code></td>
|
|
401
|
+
<td>HTTP verb the form submits with (<code>:post</code> for New, <code>:patch</code> for Edit).</td>
|
|
402
402
|
</tr>
|
|
403
403
|
<tr>
|
|
404
|
-
<td
|
|
405
|
-
<td
|
|
406
|
-
<td>Use a custom Form component instead of
|
|
404
|
+
<td><code>form_comp_class</code></td>
|
|
405
|
+
<td><code>form_comp_class(Components::X::MyForm)</code></td>
|
|
406
|
+
<td>Use a custom Form component instead of <code>Components::<Family>::Form</code>. Non-obvious uses: non-default form → <a href="/doc/guide/patterns_md.html#5-custom-form--schemacop-kept-in-sync">patterns §5</a>; token-gated signup → <a href="/doc/guide/patterns_md.html#18-signed-token-capability-links-auth-less-onboarding--magic-links">patterns §18</a>.</td>
|
|
407
407
|
</tr>
|
|
408
408
|
<tr>
|
|
409
|
-
<td
|
|
410
|
-
<td
|
|
411
|
-
<td>CanCanCan action used for per-field
|
|
409
|
+
<td><code>form_cancancan_action</code></td>
|
|
410
|
+
<td><code>form_cancancan_action(:edit)</code></td>
|
|
411
|
+
<td>CanCanCan action used for per-field <code>permitted_attributes</code>. Pass <code>nil</code> to disable per-field auth (e.g. token-gated forms → <a href="/doc/guide/patterns_md.html#18-signed-token-capability-links-auth-less-onboarding--magic-links">patterns §18</a>).</td>
|
|
412
412
|
</tr>
|
|
413
413
|
<tr>
|
|
414
|
-
<td
|
|
415
|
-
<td
|
|
416
|
-
<td>Override where the form POSTs/PATCHes to. Non-obvious use: carry a token through submit →
|
|
414
|
+
<td><code>submit_path</code></td>
|
|
415
|
+
<td><code>submit_path { Compony.path(...) }</code></td>
|
|
416
|
+
<td>Override where the form POSTs/PATCHes to. Non-obvious use: carry a token through submit → <a href="/doc/guide/patterns_md.html#18-signed-token-capability-links-auth-less-onboarding--magic-links">patterns §18</a>.</td>
|
|
417
417
|
</tr>
|
|
418
418
|
<tr>
|
|
419
|
-
<td
|
|
420
|
-
<td
|
|
419
|
+
<td><code>on_created</code> / <code>on_updated</code></td>
|
|
420
|
+
<td><code>on_created { ... }</code></td>
|
|
421
421
|
<td>Post-save, pre-respond hook (success).</td>
|
|
422
422
|
</tr>
|
|
423
423
|
<tr>
|
|
424
|
-
<td
|
|
425
|
-
<td
|
|
424
|
+
<td><code>on_created_respond</code> / <code>on_updated_respond</code></td>
|
|
425
|
+
<td><code>... { ... }</code></td>
|
|
426
426
|
<td>Override the success response (default: flash + redirect).</td>
|
|
427
427
|
</tr>
|
|
428
428
|
<tr>
|
|
429
|
-
<td
|
|
430
|
-
<td
|
|
431
|
-
<td>Override the success redirect target. Non-obvious use: chain wizard steps →
|
|
429
|
+
<td><code>on_created_redirect_path</code> / <code>on_updated_redirect_path</code></td>
|
|
430
|
+
<td><code>... { path }</code></td>
|
|
431
|
+
<td>Override the success redirect target. Non-obvious use: chain wizard steps → <a href="/doc/guide/patterns_md.html#16-multi-step-wizard-across-components">patterns §16</a>.</td>
|
|
432
432
|
</tr>
|
|
433
433
|
<tr>
|
|
434
|
-
<td
|
|
435
|
-
<td
|
|
434
|
+
<td><code>on_create_failed_respond</code> / <code>on_update_failed</code></td>
|
|
435
|
+
<td><code>... { ... }</code></td>
|
|
436
436
|
<td>Override the validation-failure response.</td>
|
|
437
437
|
</tr>
|
|
438
438
|
<tr>
|
|
439
|
-
<td
|
|
440
|
-
<td
|
|
439
|
+
<td><code>on_destroyed</code> / <code>on_destroyed_respond</code> / <code>on_destroyed_redirect_path</code></td>
|
|
440
|
+
<td><code>... { ... }</code></td>
|
|
441
441
|
<td>Destroy component equivalents.</td>
|
|
442
442
|
</tr>
|
|
443
443
|
</tbody>
|
|
444
444
|
</table>
|
|
445
445
|
|
|
446
|
-
<h2 id="
|
|
446
|
+
<h2 id="list--index-component-dsl">List / Index component DSL</h2>
|
|
447
447
|
|
|
448
448
|
<p><code>Compony::Components::List</code> (nest in Index or owner Show); <code>Compony::Components::Index</code>.</p>
|
|
449
449
|
|
|
@@ -458,93 +458,93 @@
|
|
|
458
458
|
</thead>
|
|
459
459
|
<tbody>
|
|
460
460
|
<tr>
|
|
461
|
-
<td
|
|
461
|
+
<td><code>column</code></td>
|
|
462
462
|
<td>setup</td>
|
|
463
|
-
<td
|
|
463
|
+
<td><code>column(:name, label: nil, class: nil, link_opts: {}) { |record| ... }</code></td>
|
|
464
464
|
<td>Add/define a column; block renders the cell.</td>
|
|
465
465
|
</tr>
|
|
466
466
|
<tr>
|
|
467
|
-
<td
|
|
467
|
+
<td><code>columns</code></td>
|
|
468
468
|
<td>setup</td>
|
|
469
|
-
<td
|
|
470
|
-
<td>Add several field-based columns.
|
|
469
|
+
<td><code>columns(:a, :b, as_title: false)</code></td>
|
|
470
|
+
<td>Add several field-based columns. <code>as_title: true</code> = card title on mobile.</td>
|
|
471
471
|
</tr>
|
|
472
472
|
<tr>
|
|
473
|
-
<td
|
|
473
|
+
<td><code>filter</code></td>
|
|
474
474
|
<td>setup</td>
|
|
475
|
-
<td
|
|
475
|
+
<td><code>filter(:name, label: nil) { |f| ... }</code></td>
|
|
476
476
|
<td>Add/define a filter; block customizes the input.</td>
|
|
477
477
|
</tr>
|
|
478
478
|
<tr>
|
|
479
|
-
<td
|
|
479
|
+
<td><code>filters</code></td>
|
|
480
480
|
<td>setup</td>
|
|
481
|
-
<td
|
|
481
|
+
<td><code>filters(:a, :b)</code></td>
|
|
482
482
|
<td>Add several filters.</td>
|
|
483
483
|
</tr>
|
|
484
484
|
<tr>
|
|
485
|
-
<td
|
|
485
|
+
<td><code>sort</code></td>
|
|
486
486
|
<td>setup</td>
|
|
487
|
-
<td
|
|
487
|
+
<td><code>sort(:name, label: nil)</code></td>
|
|
488
488
|
<td>Add a sort option.</td>
|
|
489
489
|
</tr>
|
|
490
490
|
<tr>
|
|
491
|
-
<td
|
|
491
|
+
<td><code>sorts</code></td>
|
|
492
492
|
<td>setup</td>
|
|
493
|
-
<td
|
|
493
|
+
<td><code>sorts(:a, :b)</code></td>
|
|
494
494
|
<td>Add several sort options.</td>
|
|
495
495
|
</tr>
|
|
496
496
|
<tr>
|
|
497
|
-
<td
|
|
497
|
+
<td><code>default_sorting</code></td>
|
|
498
498
|
<td>setup</td>
|
|
499
|
-
<td
|
|
499
|
+
<td><code>default_sorting('id desc')</code></td>
|
|
500
500
|
<td>Default Ransack sort string.</td>
|
|
501
501
|
</tr>
|
|
502
502
|
<tr>
|
|
503
|
-
<td
|
|
503
|
+
<td><code>row_intents</code></td>
|
|
504
504
|
<td>setup</td>
|
|
505
|
-
<td
|
|
506
|
-
<td>Per-row action buttons (intent DSL) →
|
|
505
|
+
<td><code>row_intents(**opts) { add/remove }</code></td>
|
|
506
|
+
<td>Per-row action buttons (intent DSL) → <a href="/doc/guide/patterns_md.html#4-list-customization">patterns §4</a>.</td>
|
|
507
507
|
</tr>
|
|
508
508
|
<tr>
|
|
509
|
-
<td
|
|
509
|
+
<td><code>pagination</code></td>
|
|
510
510
|
<td>setup</td>
|
|
511
|
-
<td
|
|
511
|
+
<td><code>pagination(false)</code></td>
|
|
512
512
|
<td>Enable/disable pagination (caution: loads all rows).</td>
|
|
513
513
|
</tr>
|
|
514
514
|
<tr>
|
|
515
|
-
<td
|
|
515
|
+
<td><code>results_per_page</code></td>
|
|
516
516
|
<td>setup</td>
|
|
517
|
-
<td
|
|
517
|
+
<td><code>results_per_page(20)</code></td>
|
|
518
518
|
<td>Rows per page when paginating.</td>
|
|
519
519
|
</tr>
|
|
520
520
|
<tr>
|
|
521
|
-
<td
|
|
521
|
+
<td><code>filtering</code></td>
|
|
522
522
|
<td>setup</td>
|
|
523
|
-
<td
|
|
523
|
+
<td><code>filtering(false)</code></td>
|
|
524
524
|
<td>Enable/disable filtering entirely.</td>
|
|
525
525
|
</tr>
|
|
526
526
|
<tr>
|
|
527
|
-
<td
|
|
527
|
+
<td><code>sorting</code></td>
|
|
528
528
|
<td>setup</td>
|
|
529
|
-
<td
|
|
529
|
+
<td><code>sorting(false)</code></td>
|
|
530
530
|
<td>Enable/disable both sorting links and in-filter sorting.</td>
|
|
531
531
|
</tr>
|
|
532
532
|
<tr>
|
|
533
|
-
<td
|
|
533
|
+
<td><code>sorting_in_filter</code> / <code>sorting_links</code></td>
|
|
534
534
|
<td>setup</td>
|
|
535
|
-
<td
|
|
535
|
+
<td><code>sorting_links(false)</code></td>
|
|
536
536
|
<td>Toggle one sorting UI independently.</td>
|
|
537
537
|
</tr>
|
|
538
538
|
<tr>
|
|
539
|
-
<td
|
|
539
|
+
<td><code>filter_label_class</code> / <code>filter_input_class</code> / <code>filter_select_class</code></td>
|
|
540
540
|
<td>setup</td>
|
|
541
|
-
<td
|
|
541
|
+
<td><code>filter_input_class('...')</code></td>
|
|
542
542
|
<td>CSS classes for filter form elements.</td>
|
|
543
543
|
</tr>
|
|
544
544
|
<tr>
|
|
545
|
-
<td
|
|
545
|
+
<td><code>skip_column</code></td>
|
|
546
546
|
<td>setup</td>
|
|
547
|
-
<td
|
|
547
|
+
<td><code>skip_column(:name)</code></td>
|
|
548
548
|
<td>Remove an inherited column (Show/List).</td>
|
|
549
549
|
</tr>
|
|
550
550
|
</tbody>
|
|
@@ -552,7 +552,7 @@
|
|
|
552
552
|
|
|
553
553
|
<p>Many of these also accept <code>skip_*</code> kwargs on the constructor when the List is nested via <code>render_sub_comp</code> (e.g. <code>render_sub_comp(:list, coll, skip_pagination: true)</code>).</p>
|
|
554
554
|
|
|
555
|
-
<h2 id="
|
|
555
|
+
<h2 id="model-mixin-in-your-applicationrecord-models">Model mixin (in your <code>ApplicationRecord</code> models)</h2>
|
|
556
556
|
|
|
557
557
|
<table role="table">
|
|
558
558
|
<thead>
|
|
@@ -565,53 +565,53 @@
|
|
|
565
565
|
</thead>
|
|
566
566
|
<tbody>
|
|
567
567
|
<tr>
|
|
568
|
-
<td
|
|
568
|
+
<td><code>field</code></td>
|
|
569
569
|
<td>model (class)</td>
|
|
570
|
-
<td
|
|
570
|
+
<td><code>field(:name, :type, multilang: false, **attrs)</code></td>
|
|
571
571
|
<td>Declare a UI-relevant attribute + its type/formatting.</td>
|
|
572
572
|
</tr>
|
|
573
573
|
<tr>
|
|
574
|
-
<td
|
|
574
|
+
<td><code>prevent</code></td>
|
|
575
575
|
<td>model (class)</td>
|
|
576
|
-
<td
|
|
576
|
+
<td><code>prevent(:destroy, 'msg') { condition }</code></td>
|
|
577
577
|
<td>Feasibility: block returns truthy → action prevented (buttons disabled).</td>
|
|
578
578
|
</tr>
|
|
579
579
|
<tr>
|
|
580
|
-
<td
|
|
580
|
+
<td><code>owned_by</code></td>
|
|
581
581
|
<td>model (class)</td>
|
|
582
|
-
<td
|
|
582
|
+
<td><code>owned_by(:invoice)</code></td>
|
|
583
583
|
<td>Mark this model as owned by another; adjusts redirects/top actions.</td>
|
|
584
584
|
</tr>
|
|
585
585
|
<tr>
|
|
586
|
-
<td
|
|
586
|
+
<td><code>skip_autodetect_feasibilities</code></td>
|
|
587
587
|
<td>model (class)</td>
|
|
588
|
-
<td
|
|
589
|
-
<td>Don’t auto-derive
|
|
588
|
+
<td><code>skip_autodetect_feasibilities</code></td>
|
|
589
|
+
<td>Don’t auto-derive <code>:destroy</code> preventions from <code>dependent:</code> associations.</td>
|
|
590
590
|
</tr>
|
|
591
591
|
<tr>
|
|
592
|
-
<td
|
|
592
|
+
<td><code>feasible?</code></td>
|
|
593
593
|
<td>model (instance)</td>
|
|
594
|
-
<td
|
|
594
|
+
<td><code>record.feasible?(:destroy)</code></td>
|
|
595
595
|
<td>True if no prevention blocks the action.</td>
|
|
596
596
|
</tr>
|
|
597
597
|
<tr>
|
|
598
|
-
<td
|
|
598
|
+
<td><code>feasibility_messages</code></td>
|
|
599
599
|
<td>model (instance)</td>
|
|
600
|
-
<td
|
|
601
|
-
<td>Array of reasons (like
|
|
600
|
+
<td><code>record.feasibility_messages(:destroy)</code></td>
|
|
601
|
+
<td>Array of reasons (like <code>errors</code>).</td>
|
|
602
602
|
</tr>
|
|
603
603
|
<tr>
|
|
604
|
-
<td
|
|
604
|
+
<td><code>full_feasibility_messages</code></td>
|
|
605
605
|
<td>model (instance)</td>
|
|
606
|
-
<td
|
|
607
|
-
<td>Joined human string (like
|
|
606
|
+
<td><code>record.full_feasibility_messages(:destroy)</code></td>
|
|
607
|
+
<td>Joined human string (like <code>full_messages</code>).</td>
|
|
608
608
|
</tr>
|
|
609
609
|
</tbody>
|
|
610
610
|
</table>
|
|
611
611
|
|
|
612
612
|
<p><code>label</code> is not a DSL method but <strong>every Compony model must implement <code>def label</code></strong> (or have a <code>label</code> column) — used for titles and link text.</p>
|
|
613
613
|
|
|
614
|
-
<h2 id="
|
|
614
|
+
<h2 id="intent--navigation-helpers">Intent / navigation helpers</h2>
|
|
615
615
|
|
|
616
616
|
<p>Used from <code>content</code> blocks or controllers — see <a href="/doc/guide/intents_md.html">intents.md</a>.</p>
|
|
617
617
|
|
|
@@ -626,34 +626,34 @@
|
|
|
626
626
|
</thead>
|
|
627
627
|
<tbody>
|
|
628
628
|
<tr>
|
|
629
|
-
<td
|
|
629
|
+
<td><code>Compony.intent</code></td>
|
|
630
630
|
<td>anywhere</td>
|
|
631
|
-
<td
|
|
632
|
-
<td>Build an
|
|
631
|
+
<td><code>Compony.intent(:show, model, **opts)</code></td>
|
|
632
|
+
<td>Build an <code>Intent</code>.</td>
|
|
633
633
|
</tr>
|
|
634
634
|
<tr>
|
|
635
|
-
<td
|
|
635
|
+
<td><code>Compony.path</code></td>
|
|
636
636
|
<td>anywhere</td>
|
|
637
|
-
<td
|
|
637
|
+
<td><code>Compony.path(:index, :users, **opts)</code></td>
|
|
638
638
|
<td>Rails path string (redirects).</td>
|
|
639
639
|
</tr>
|
|
640
640
|
<tr>
|
|
641
|
-
<td
|
|
641
|
+
<td><code>render_intent</code></td>
|
|
642
642
|
<td>content</td>
|
|
643
|
-
<td
|
|
644
|
-
<td>Render a link/button to a component. Wrap in
|
|
643
|
+
<td><code>render_intent(:edit, model, style:, label:, button:)</code></td>
|
|
644
|
+
<td>Render a link/button to a component. Wrap in <code>concat</code>.</td>
|
|
645
645
|
</tr>
|
|
646
646
|
<tr>
|
|
647
|
-
<td
|
|
647
|
+
<td><code>render_sub_comp</code></td>
|
|
648
648
|
<td>content</td>
|
|
649
|
-
<td
|
|
650
|
-
<td>Instantiate + nest another component. Wrap in
|
|
649
|
+
<td><code>render_sub_comp(:list, @data.quotes, **opts)</code></td>
|
|
650
|
+
<td>Instantiate + nest another component. Wrap in <code>concat</code>.</td>
|
|
651
651
|
</tr>
|
|
652
652
|
<tr>
|
|
653
|
-
<td
|
|
653
|
+
<td><code>Compony.comp_class_for</code></td>
|
|
654
654
|
<td>anywhere</td>
|
|
655
|
-
<td
|
|
656
|
-
<td>Comp class or
|
|
655
|
+
<td><code>Compony.comp_class_for(:show, family)</code></td>
|
|
656
|
+
<td>Comp class or <code>nil</code>.</td>
|
|
657
657
|
</tr>
|
|
658
658
|
</tbody>
|
|
659
659
|
</table>
|
|
@@ -662,7 +662,7 @@
|
|
|
662
662
|
</div></div>
|
|
663
663
|
|
|
664
664
|
<div id="footer">
|
|
665
|
-
Generated on
|
|
665
|
+
Generated on Tue Aug 18 14:36:34 2026 by
|
|
666
666
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
667
667
|
0.9.34 (ruby-3.4.9).
|
|
668
668
|
</div>
|