compony 0.11.14 → 0.12.0
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/CHANGELOG.md +30 -0
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/compony.gemspec +3 -3
- data/config/locales/de.yml +1 -1
- data/config/locales/en.yml +1 -1
- data/config/locales/es.yml +1 -1
- data/config/locales/fr.yml +1 -1
- 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 +12 -1
- data/doc/Compony/Components/Buttons/Link.html +239 -16
- 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 +83 -83
- 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 +1 -1
- 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 +13 -11
- data/doc/Compony/ModelFields/Base.html +1 -1
- 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 +32 -9
- data/doc/file.README.html +1 -1
- data/doc/file.basic_component.html +1 -1
- data/doc/file.cookbook.html +1 -1
- data/doc/file.destroy.html +1 -1
- data/doc/file.dsl_reference.html +1 -1
- data/doc/file.edit.html +1 -1
- data/doc/file.example.html +1 -1
- data/doc/file.example_advanced.html +1 -1
- data/doc/file.feasibility.html +1 -1
- data/doc/file.form.html +1 -1
- data/doc/file.generators.html +1 -1
- data/doc/file.glossary.html +1 -1
- data/doc/file.gotchas.html +1 -1
- data/doc/file.index.html +1 -1
- data/doc/file.inheritance.html +1 -1
- data/doc/file.installation.html +1 -1
- data/doc/file.integrations.html +32 -2
- data/doc/file.intents.html +8 -4
- data/doc/file.internal_datastructures.html +1 -1
- data/doc/file.list.html +3 -1
- data/doc/file.maintaining.html +1 -1
- data/doc/file.model_fields.html +1 -1
- data/doc/file.nesting.html +1 -1
- data/doc/file.new.html +1 -1
- data/doc/file.ownership.html +1 -1
- data/doc/file.patterns.html +1 -1
- data/doc/file.pre_built_components.html +1 -1
- data/doc/file.resourceful.html +1 -1
- data/doc/file.show.html +1 -1
- data/doc/file.standalone.html +1 -1
- data/doc/file.virtual_models.html +1 -1
- data/doc/file.with_form.html +1 -1
- data/doc/guide/intents.md +6 -3
- data/doc/guide/pre_built_components/list.md +4 -0
- data/doc/index.html +1 -1
- data/doc/integrations.md +46 -1
- data/doc/method_list.html +69 -53
- data/doc/top-level-namespace.html +1 -1
- data/lib/compony/components/buttons/link.rb +37 -2
- data/lib/compony/components/form.rb +2 -6
- data/lib/compony/model_fields/attachment.rb +7 -6
- data/spec/compony/components/buttons/link_spec.rb +73 -0
- data/spec/compony/model_fields/attachment_spec.rb +41 -0
- data/spec/requests/users_crud_spec.rb +7 -0
- metadata +3 -1
|
@@ -115,6 +115,33 @@
|
|
|
115
115
|
<p class="children"><span class='object_link'><a href="CssButton.html" title="Compony::Components::Buttons::CssButton (class)">CssButton</a></span></p>
|
|
116
116
|
</div>
|
|
117
117
|
|
|
118
|
+
|
|
119
|
+
<h2>
|
|
120
|
+
Constant Summary
|
|
121
|
+
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
|
122
|
+
</h2>
|
|
123
|
+
|
|
124
|
+
<dl class="constants">
|
|
125
|
+
|
|
126
|
+
<dt id="NO_HREF-constant" class="">NO_HREF =
|
|
127
|
+
<div class="docstring">
|
|
128
|
+
<div class="discussion">
|
|
129
|
+
|
|
130
|
+
<p>Legacy value of <code>@href</code> when no <code>href</code> was given. <span class='object_link'><a href="#link_or_button-instance_method" title="Compony::Components::Buttons::Link#link_or_button (method)">#link_or_button</a></span> renders an <code><a></code> without <code>href</code> in this case. The value only remains so that button styles that still call <code>link_to(@href, ...)</code> themselves keep their former markup until they render through <span class='object_link'><a href="#link_or_button-instance_method" title="Compony::Components::Buttons::Link#link_or_button (method)">#link_or_button</a></span>. A <code>javascript:</code> URL violates any Content Security Policy that does not allow inline scripts.</p>
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
<div class="tags">
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
</div>
|
|
139
|
+
</dt>
|
|
140
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>javascript:void(0)</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
|
141
|
+
|
|
142
|
+
</dl>
|
|
143
|
+
|
|
144
|
+
|
|
118
145
|
|
|
119
146
|
|
|
120
147
|
|
|
@@ -134,6 +161,30 @@
|
|
|
134
161
|
|
|
135
162
|
<ul class="summary">
|
|
136
163
|
|
|
164
|
+
<li class="public ">
|
|
165
|
+
<span class="summary_signature">
|
|
166
|
+
|
|
167
|
+
<a href="#link_or_button-instance_method" title="#link_or_button (instance method)">#<strong>link_or_button</strong>(inner_html = @label, html_opts = @comp_opts) ⇒ Object </a>
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
</span>
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
<span class="summary_desc"><div class='inline'>
|
|
182
|
+
<p>Renders the HTML element of this button: - a <code><button></code> of the given type if <code>type:</code> was given (e.g. <code>:submit</code> for a form’s submit button), - an <code><a></code> without <code>href</code> if no <code>href</code> was given (clicking it does nothing, and it needs no JavaScript), - a regular link otherwise.</p>
|
|
183
|
+
</div></span>
|
|
184
|
+
|
|
185
|
+
</li>
|
|
186
|
+
|
|
187
|
+
|
|
137
188
|
<li class="protected ">
|
|
138
189
|
<span class="summary_signature">
|
|
139
190
|
|
|
@@ -151,6 +202,28 @@
|
|
|
151
202
|
|
|
152
203
|
|
|
153
204
|
|
|
205
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
206
|
+
|
|
207
|
+
</li>
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
<li class="public ">
|
|
211
|
+
<span class="summary_signature">
|
|
212
|
+
|
|
213
|
+
<a href="#render-instance_method" title="#render (instance method)">#<strong>render</strong> ⇒ Object </a>
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
</span>
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
154
227
|
<span class="summary_desc"><div class='inline'></div></span>
|
|
155
228
|
|
|
156
229
|
</li>
|
|
@@ -169,7 +242,7 @@
|
|
|
169
242
|
|
|
170
243
|
|
|
171
244
|
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="../../Component.html" title="Compony::Component (class)">Compony::Component</a></span></h3>
|
|
172
|
-
<p class="inherited"><span class='object_link'><a href="../../Component.html#before_render-instance_method" title="Compony::Component#before_render (method)">#before_render</a></span>, <span class='object_link'><a href="../../Component.html#comp_name-class_method" title="Compony::Component.comp_name (method)">comp_name</a></span>, <span class='object_link'><a href="../../Component.html#content-instance_method" title="Compony::Component#content (method)">#content</a></span>, <span class='object_link'><a href="../../Component.html#exposed_intents-instance_method" title="Compony::Component#exposed_intents (method)">#exposed_intents</a></span>, <span class='object_link'><a href="../../Component.html#family_name-class_method" title="Compony::Component.family_name (method)">family_name</a></span>, <span class='object_link'><a href="../../Component.html#id-instance_method" title="Compony::Component#id (method)">#id</a></span>, <span class='object_link'><a href="../../Component.html#id_path-instance_method" title="Compony::Component#id_path (method)">#id_path</a></span>, <span class='object_link'><a href="../../Component.html#id_path_hash-instance_method" title="Compony::Component#id_path_hash (method)">#id_path_hash</a></span>, <span class='object_link'><a href="../../Component.html#initialize-instance_method" title="Compony::Component#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="../../Component.html#inspect-instance_method" title="Compony::Component#inspect (method)">#inspect</a></span>, <span class='object_link'><a href="../../Component.html#param_name-instance_method" title="Compony::Component#param_name (method)">#param_name</a></span>, <span class='object_link'><a href="../../Component.html#path-instance_method" title="Compony::Component#path (method)">#path</a></span>, <span class='object_link'><a href="../../Component.html#remove_content-instance_method" title="Compony::Component#remove_content (method)">#remove_content</a></span>, <span class='object_link'><a href="../../Component.html#remove_content!-instance_method" title="Compony::Component#remove_content! (method)">#remove_content!</a></span>, <span class='object_link'><a href="../../Component.html#
|
|
245
|
+
<p class="inherited"><span class='object_link'><a href="../../Component.html#before_render-instance_method" title="Compony::Component#before_render (method)">#before_render</a></span>, <span class='object_link'><a href="../../Component.html#comp_name-class_method" title="Compony::Component.comp_name (method)">comp_name</a></span>, <span class='object_link'><a href="../../Component.html#content-instance_method" title="Compony::Component#content (method)">#content</a></span>, <span class='object_link'><a href="../../Component.html#exposed_intents-instance_method" title="Compony::Component#exposed_intents (method)">#exposed_intents</a></span>, <span class='object_link'><a href="../../Component.html#family_name-class_method" title="Compony::Component.family_name (method)">family_name</a></span>, <span class='object_link'><a href="../../Component.html#id-instance_method" title="Compony::Component#id (method)">#id</a></span>, <span class='object_link'><a href="../../Component.html#id_path-instance_method" title="Compony::Component#id_path (method)">#id_path</a></span>, <span class='object_link'><a href="../../Component.html#id_path_hash-instance_method" title="Compony::Component#id_path_hash (method)">#id_path_hash</a></span>, <span class='object_link'><a href="../../Component.html#initialize-instance_method" title="Compony::Component#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="../../Component.html#inspect-instance_method" title="Compony::Component#inspect (method)">#inspect</a></span>, <span class='object_link'><a href="../../Component.html#param_name-instance_method" title="Compony::Component#param_name (method)">#param_name</a></span>, <span class='object_link'><a href="../../Component.html#path-instance_method" title="Compony::Component#path (method)">#path</a></span>, <span class='object_link'><a href="../../Component.html#remove_content-instance_method" title="Compony::Component#remove_content (method)">#remove_content</a></span>, <span class='object_link'><a href="../../Component.html#remove_content!-instance_method" title="Compony::Component#remove_content! (method)">#remove_content!</a></span>, <span class='object_link'><a href="../../Component.html#resourceful%3F-instance_method" title="Compony::Component#resourceful? (method)">#resourceful?</a></span>, <span class='object_link'><a href="../../Component.html#root_comp-instance_method" title="Compony::Component#root_comp (method)">#root_comp</a></span>, <span class='object_link'><a href="../../Component.html#root_comp%3F-instance_method" title="Compony::Component#root_comp? (method)">#root_comp?</a></span>, <span class='object_link'><a href="../../Component.html#setup-class_method" title="Compony::Component.setup (method)">setup</a></span>, <span class='object_link'><a href="../../Component.html#sub_comp-instance_method" title="Compony::Component#sub_comp (method)">#sub_comp</a></span></p>
|
|
173
246
|
<div id="constructor_details" class="method_details_list">
|
|
174
247
|
<h2>Constructor Details</h2>
|
|
175
248
|
|
|
@@ -183,7 +256,106 @@
|
|
|
183
256
|
|
|
184
257
|
|
|
185
258
|
<div class="method_details first">
|
|
186
|
-
<h3 class="signature first" id="
|
|
259
|
+
<h3 class="signature first" id="link_or_button-instance_method">
|
|
260
|
+
|
|
261
|
+
#<strong>link_or_button</strong>(inner_html = @label, html_opts = @comp_opts) ⇒ <tt>Object</tt>
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
</h3><div class="docstring">
|
|
268
|
+
<div class="discussion">
|
|
269
|
+
|
|
270
|
+
<p>Renders the HTML element of this button: - a <code><button></code> of the given type if <code>type:</code> was given (e.g. <code>:submit</code> for a form’s submit button), - an <code><a></code> without <code>href</code> if no <code>href</code> was given (clicking it does nothing, and it needs no JavaScript), - a regular link otherwise. Button styles that override <code>content</code> must render through this method rather than calling <code>link_to(@href, ...)</code> themselves.</p>
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
</div>
|
|
274
|
+
</div>
|
|
275
|
+
<div class="tags">
|
|
276
|
+
<p class="tag_title">Parameters:</p>
|
|
277
|
+
<ul class="param">
|
|
278
|
+
|
|
279
|
+
<li>
|
|
280
|
+
|
|
281
|
+
<span class='name'>inner_html</span>
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
<em class="default">(defaults to: <tt>@label</tt>)</em>
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
—
|
|
291
|
+
<div class='inline'>
|
|
292
|
+
<p>Content of the element, defaults to the label. To pass markup, use e.g. <code>capture { span 'x' }</code>.</p>
|
|
293
|
+
</div>
|
|
294
|
+
|
|
295
|
+
</li>
|
|
296
|
+
|
|
297
|
+
<li>
|
|
298
|
+
|
|
299
|
+
<span class='name'>html_opts</span>
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
<em class="default">(defaults to: <tt>@comp_opts</tt>)</em>
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
—
|
|
309
|
+
<div class='inline'>
|
|
310
|
+
<p>HTML attributes of the element, defaults to the button’s options left after <code>prepare_opts!</code>.</p>
|
|
311
|
+
</div>
|
|
312
|
+
|
|
313
|
+
</li>
|
|
314
|
+
|
|
315
|
+
</ul>
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
</div><table class="source_code">
|
|
319
|
+
<tr>
|
|
320
|
+
<td>
|
|
321
|
+
<pre class="lines">
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
36
|
|
325
|
+
37
|
|
326
|
+
38
|
|
327
|
+
39
|
|
328
|
+
40
|
|
329
|
+
41
|
|
330
|
+
42
|
|
331
|
+
43
|
|
332
|
+
44
|
|
333
|
+
45
|
|
334
|
+
46
|
|
335
|
+
47</pre>
|
|
336
|
+
</td>
|
|
337
|
+
<td>
|
|
338
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/buttons/link.rb', line 36</span>
|
|
339
|
+
|
|
340
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_link_or_button'>link_or_button</span><span class='lparen'>(</span><span class='id identifier rubyid_inner_html'>inner_html</span> <span class='op'>=</span> <span class='ivar'>@label</span><span class='comma'>,</span> <span class='id identifier rubyid_html_opts'>html_opts</span> <span class='op'>=</span> <span class='ivar'>@comp_opts</span><span class='rparen'>)</span>
|
|
341
|
+
<span class='ivar'>@link_or_button_rendered</span> <span class='op'>=</span> <span class='kw'>true</span>
|
|
342
|
+
<span class='id identifier rubyid_helpers'>helpers</span> <span class='op'>=</span> <span class='const'>ActionController</span><span class='op'>::</span><span class='const'>Base</span><span class='period'>.</span><span class='id identifier rubyid_helpers'>helpers</span>
|
|
343
|
+
<span class='kw'>if</span> <span class='ivar'>@type</span>
|
|
344
|
+
<span class='id identifier rubyid_disabled'>disabled</span> <span class='op'>=</span> <span class='id identifier rubyid_html_opts'>html_opts</span><span class='lbracket'>[</span><span class='symbol'>:disabled</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='id identifier rubyid_html_opts'>html_opts</span><span class='lbracket'>[</span><span class='symbol'>:class</span><span class='rbracket'>]</span><span class='op'>&.</span><span class='id identifier rubyid_split'>split</span><span class='op'>&.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>disabled</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
|
345
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_helpers'>helpers</span><span class='period'>.</span><span class='id identifier rubyid_content_tag'>content_tag</span><span class='lparen'>(</span><span class='symbol'>:button</span><span class='comma'>,</span> <span class='id identifier rubyid_inner_html'>inner_html</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_html_opts'>html_opts</span><span class='comma'>,</span> <span class='label'>type:</span> <span class='ivar'>@type</span><span class='comma'>,</span> <span class='label'>disabled:</span><span class='rparen'>)</span>
|
|
346
|
+
<span class='kw'>elsif</span> <span class='ivar'>@href</span> <span class='op'>==</span> <span class='const'><span class='object_link'><a href="#NO_HREF-constant" title="Compony::Components::Buttons::Link::NO_HREF (constant)">NO_HREF</a></span></span>
|
|
347
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_helpers'>helpers</span><span class='period'>.</span><span class='id identifier rubyid_content_tag'>content_tag</span><span class='lparen'>(</span><span class='symbol'>:a</span><span class='comma'>,</span> <span class='id identifier rubyid_inner_html'>inner_html</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_html_opts'>html_opts</span><span class='rparen'>)</span>
|
|
348
|
+
<span class='kw'>else</span>
|
|
349
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_helpers'>helpers</span><span class='period'>.</span><span class='id identifier rubyid_link_to'>link_to</span><span class='lparen'>(</span><span class='id identifier rubyid_inner_html'>inner_html</span><span class='comma'>,</span> <span class='ivar'>@href</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_html_opts'>html_opts</span><span class='rparen'>)</span>
|
|
350
|
+
<span class='kw'>end</span>
|
|
351
|
+
<span class='kw'>end</span></pre>
|
|
352
|
+
</td>
|
|
353
|
+
</tr>
|
|
354
|
+
</table>
|
|
355
|
+
</div>
|
|
356
|
+
|
|
357
|
+
<div class="method_details ">
|
|
358
|
+
<h3 class="signature " id="prepare_opts!-instance_method">
|
|
187
359
|
|
|
188
360
|
#<strong>prepare_opts!</strong> ⇒ <tt>Object</tt> <span class="extras">(protected)</span>
|
|
189
361
|
|
|
@@ -206,24 +378,26 @@
|
|
|
206
378
|
<pre class="lines">
|
|
207
379
|
|
|
208
380
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
381
|
+
51
|
|
382
|
+
52
|
|
383
|
+
53
|
|
384
|
+
54
|
|
385
|
+
55
|
|
386
|
+
56
|
|
387
|
+
57
|
|
388
|
+
58
|
|
389
|
+
59
|
|
390
|
+
60
|
|
391
|
+
61
|
|
392
|
+
62</pre>
|
|
220
393
|
</td>
|
|
221
394
|
<td>
|
|
222
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/buttons/link.rb', line
|
|
395
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/buttons/link.rb', line 51</span>
|
|
223
396
|
|
|
224
397
|
<span class='kw'>def</span> <span class='id identifier rubyid_prepare_opts!'>prepare_opts!</span>
|
|
225
398
|
<span class='ivar'>@label</span> <span class='op'>=</span> <span class='ivar'>@comp_opts</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:label</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_presence'>presence</span>
|
|
226
|
-
<span class='ivar'>@href</span> <span class='op'>=</span> <span class='ivar'>@comp_opts</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:href</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_presence'>presence</span> <span class='op'>||</span> <span class='
|
|
399
|
+
<span class='ivar'>@href</span> <span class='op'>=</span> <span class='ivar'>@comp_opts</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:href</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_presence'>presence</span> <span class='op'>||</span> <span class='const'><span class='object_link'><a href="#NO_HREF-constant" title="Compony::Components::Buttons::Link::NO_HREF (constant)">NO_HREF</a></span></span>
|
|
400
|
+
<span class='ivar'>@type</span> <span class='op'>=</span> <span class='ivar'>@comp_opts</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:type</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_presence'>presence</span><span class='op'>&.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
|
|
227
401
|
<span class='ivar'>@method</span> <span class='op'>=</span> <span class='ivar'>@comp_opts</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:method</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_presence'>presence</span>
|
|
228
402
|
<span class='kw'>if</span> <span class='ivar'>@method</span> <span class='op'>&&</span> <span class='ivar'>@method</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span> <span class='op'>!=</span> <span class='symbol'>:get</span>
|
|
229
403
|
<span class='ivar'>@comp_opts</span><span class='lbracket'>[</span><span class='symbol'>:data</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='label'>turbo_method:</span> <span class='ivar'>@method</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='ivar'>@comp_opts</span><span class='lbracket'>[</span><span class='symbol'>:data</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
|
@@ -235,6 +409,55 @@
|
|
|
235
409
|
</td>
|
|
236
410
|
</tr>
|
|
237
411
|
</table>
|
|
412
|
+
</div>
|
|
413
|
+
|
|
414
|
+
<div class="method_details ">
|
|
415
|
+
<h3 class="signature " id="render-instance_method">
|
|
416
|
+
|
|
417
|
+
#<strong>render</strong> ⇒ <tt>Object</tt>
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
</h3><div class="docstring">
|
|
424
|
+
<div class="discussion">
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
</div>
|
|
428
|
+
</div>
|
|
429
|
+
<div class="tags">
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
</div><table class="source_code">
|
|
433
|
+
<tr>
|
|
434
|
+
<td>
|
|
435
|
+
<pre class="lines">
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
20
|
|
439
|
+
21
|
|
440
|
+
22
|
|
441
|
+
23
|
|
442
|
+
24
|
|
443
|
+
25
|
|
444
|
+
26
|
|
445
|
+
27</pre>
|
|
446
|
+
</td>
|
|
447
|
+
<td>
|
|
448
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/buttons/link.rb', line 20</span>
|
|
449
|
+
|
|
450
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_render'>render</span><span class='lparen'>(</span><span class='op'>...</span><span class='rparen'>)</span>
|
|
451
|
+
<span class='id identifier rubyid_html'>html</span> <span class='op'>=</span> <span class='kw'>super</span>
|
|
452
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_html'>html</span> <span class='op'>&&</span> <span class='ivar'>@type</span> <span class='op'>&&</span> <span class='op'>!</span><span class='ivar'>@link_or_button_rendered</span>
|
|
453
|
+
<span class='id identifier rubyid_fail'>fail</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='embexpr_end'>}</span><span class='tstring_content'> was given `type: </span><span class='embexpr_beg'>#{</span><span class='ivar'>@type</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'>` but did not render through `link_or_button`, so it rendered a link instead </span><span class='tstring_end'>"</span></span> \
|
|
454
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>of a <button>. Render the element with `component.link_or_button(...)` in the content block instead of `link_to`.</span><span class='tstring_end'>'</span></span>
|
|
455
|
+
<span class='kw'>end</span>
|
|
456
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_html'>html</span>
|
|
457
|
+
<span class='kw'>end</span></pre>
|
|
458
|
+
</td>
|
|
459
|
+
</tr>
|
|
460
|
+
</table>
|
|
238
461
|
</div>
|
|
239
462
|
|
|
240
463
|
</div>
|
|
@@ -242,7 +465,7 @@
|
|
|
242
465
|
</div>
|
|
243
466
|
|
|
244
467
|
<div id="footer">
|
|
245
|
-
Generated on Wed
|
|
468
|
+
Generated on Wed Nov 25 14:15:21 2026 by
|
|
246
469
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
247
470
|
0.9.34 (ruby-3.4.9).
|
|
248
471
|
</div>
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
</div>
|
|
117
117
|
|
|
118
118
|
<div id="footer">
|
|
119
|
-
Generated on Wed
|
|
119
|
+
Generated on Wed Nov 25 14:15:19 2026 by
|
|
120
120
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
121
121
|
0.9.34 (ruby-3.4.9).
|
|
122
122
|
</div>
|
|
@@ -428,7 +428,7 @@
|
|
|
428
428
|
</div>
|
|
429
429
|
|
|
430
430
|
<div id="footer">
|
|
431
|
-
Generated on Wed
|
|
431
|
+
Generated on Wed Nov 25 14:15:21 2026 by
|
|
432
432
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
433
433
|
0.9.34 (ruby-3.4.9).
|
|
434
434
|
</div>
|
|
@@ -524,7 +524,7 @@
|
|
|
524
524
|
</div>
|
|
525
525
|
|
|
526
526
|
<div id="footer">
|
|
527
|
-
Generated on Wed
|
|
527
|
+
Generated on Wed Nov 25 14:15:20 2026 by
|
|
528
528
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
529
529
|
0.9.34 (ruby-3.4.9).
|
|
530
530
|
</div>
|