compony 0.2.0 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/Gemfile.lock +3 -3
  4. data/README.md +1397 -33
  5. data/Rakefile +6 -2
  6. data/TODO.md +1 -0
  7. data/VERSION +1 -0
  8. data/app/controllers/compony_controller.rb +3 -1
  9. data/compony.gemspec +7 -7
  10. data/config/locales/fr.yml +33 -0
  11. data/doc/ComponentGenerator.html +231 -0
  12. data/doc/Components.html +105 -0
  13. data/doc/ComponentsGenerator.html +203 -0
  14. data/doc/Compony/Component.html +2098 -0
  15. data/doc/Compony/ComponentMixins/Default/Labelling.html +406 -0
  16. data/doc/Compony/ComponentMixins/Default/Standalone/ResourcefulVerbDsl.html +539 -0
  17. data/doc/Compony/ComponentMixins/Default/Standalone/StandaloneDsl.html +588 -0
  18. data/doc/Compony/ComponentMixins/Default/Standalone/VerbDsl.html +577 -0
  19. data/doc/Compony/ComponentMixins/Default/Standalone.html +692 -0
  20. data/doc/Compony/ComponentMixins/Default.html +126 -0
  21. data/doc/Compony/ComponentMixins/Resourceful.html +1193 -0
  22. data/doc/Compony/ComponentMixins.html +126 -0
  23. data/doc/Compony/Components/Button.html +293 -0
  24. data/doc/Compony/Components/Destroy.html +384 -0
  25. data/doc/Compony/Components/Edit.html +462 -0
  26. data/doc/Compony/Components/Form.html +1112 -0
  27. data/doc/Compony/Components/New.html +462 -0
  28. data/doc/Compony/Components/WithForm.html +528 -0
  29. data/doc/Compony/Components.html +126 -0
  30. data/doc/Compony/ControllerMixin.html +136 -0
  31. data/doc/Compony/Engine.html +133 -0
  32. data/doc/Compony/MethodAccessibleHash.html +453 -0
  33. data/doc/Compony/ModelFields/Anchormodel.html +383 -0
  34. data/doc/Compony/ModelFields/Association.html +613 -0
  35. data/doc/Compony/ModelFields/Attachment.html +305 -0
  36. data/doc/Compony/ModelFields/Base.html +1066 -0
  37. data/doc/Compony/ModelFields/Boolean.html +232 -0
  38. data/doc/Compony/ModelFields/Color.html +299 -0
  39. data/doc/Compony/ModelFields/Currency.html +232 -0
  40. data/doc/Compony/ModelFields/Date.html +232 -0
  41. data/doc/Compony/ModelFields/Datetime.html +232 -0
  42. data/doc/Compony/ModelFields/Decimal.html +154 -0
  43. data/doc/Compony/ModelFields/Email.html +240 -0
  44. data/doc/Compony/ModelFields/Float.html +154 -0
  45. data/doc/Compony/ModelFields/Integer.html +154 -0
  46. data/doc/Compony/ModelFields/Percentage.html +232 -0
  47. data/doc/Compony/ModelFields/Phone.html +301 -0
  48. data/doc/Compony/ModelFields/RichText.html +232 -0
  49. data/doc/Compony/ModelFields/String.html +154 -0
  50. data/doc/Compony/ModelFields/Text.html +154 -0
  51. data/doc/Compony/ModelFields/Time.html +154 -0
  52. data/doc/Compony/ModelFields/Url.html +240 -0
  53. data/doc/Compony/ModelFields.html +126 -0
  54. data/doc/Compony/ModelMixin.html +524 -0
  55. data/doc/Compony/RequestContext.html +791 -0
  56. data/doc/Compony/Version.html +139 -0
  57. data/doc/Compony/ViewHelpers.html +443 -0
  58. data/doc/Compony.html +2156 -0
  59. data/doc/ComponyController.html +124 -0
  60. data/doc/_index.html +569 -0
  61. data/doc/class_list.html +51 -0
  62. data/doc/css/common.css +1 -0
  63. data/doc/css/full_list.css +58 -0
  64. data/doc/css/style.css +497 -0
  65. data/doc/file.README.html +1565 -0
  66. data/doc/file_list.html +56 -0
  67. data/doc/frames.html +17 -0
  68. data/doc/imgs/intro-example-destroy.png +0 -0
  69. data/doc/imgs/intro-example-edit.png +0 -0
  70. data/doc/imgs/intro-example-index.png +0 -0
  71. data/doc/imgs/intro-example-new.png +0 -0
  72. data/doc/imgs/intro-example-show.png +0 -0
  73. data/doc/index.html +1565 -0
  74. data/doc/js/app.js +314 -0
  75. data/doc/js/full_list.js +216 -0
  76. data/doc/js/jquery.js +4 -0
  77. data/doc/method_list.html +1435 -0
  78. data/doc/resourceful_lifecycle.png +0 -0
  79. data/doc/top-level-namespace.html +112 -0
  80. data/lib/compony/component.rb +2 -1
  81. data/lib/compony/component_mixins/default/standalone/resourceful_verb_dsl.rb +1 -1
  82. data/lib/compony/component_mixins/default/standalone/standalone_dsl.rb +14 -3
  83. data/lib/compony/component_mixins/default/standalone/verb_dsl.rb +14 -5
  84. data/lib/compony/component_mixins/default/standalone.rb +10 -3
  85. data/lib/compony/components/form.rb +6 -1
  86. data/lib/compony/components/with_form.rb +14 -1
  87. data/lib/compony/model_fields/anchormodel.rb +0 -22
  88. data/lib/compony/model_mixin.rb +12 -2
  89. data/lib/compony/version.rb +1 -7
  90. data/logo.svg +133 -0
  91. metadata +83 -6
@@ -0,0 +1,613 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: Compony::ModelFields::Association
8
+
9
+ &mdash; Documentation by YARD 0.9.34
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "Compony::ModelFields::Association";
19
+ relpath = '../../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../../_index.html">Index (A)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../../Compony.html" title="Compony (module)">Compony</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../ModelFields.html" title="Compony::ModelFields (module)">ModelFields</a></span></span>
41
+ &raquo;
42
+ <span class="title">Association</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: Compony::ModelFields::Association
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName"><span class='object_link'><a href="Base.html" title="Compony::ModelFields::Base (class)">Base</a></span></span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next"><span class='object_link'><a href="Base.html" title="Compony::ModelFields::Base (class)">Base</a></span></li>
78
+
79
+ <li class="next">Compony::ModelFields::Association</li>
80
+
81
+ </ul>
82
+ <a href="#" class="inheritanceTree">show all</a>
83
+
84
+ </dd>
85
+ </dl>
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+ <dl>
98
+ <dt>Defined in:</dt>
99
+ <dd>lib/compony/model_fields/association.rb</dd>
100
+ </dl>
101
+
102
+ </div>
103
+
104
+ <div class="docstring">
105
+ <div class="discussion">
106
+
107
+
108
+ </div>
109
+ </div>
110
+ <div class="tags">
111
+
112
+
113
+ </div>
114
+
115
+
116
+
117
+
118
+
119
+ <h2>Instance Attribute Summary</h2>
120
+
121
+ <h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Base.html" title="Compony::ModelFields::Base (class)">Base</a></span></h3>
122
+ <p class="inherited"><span class='object_link'><a href="Base.html#extra_attrs-instance_method" title="Compony::ModelFields::Base#extra_attrs (method)">#extra_attrs</a></span>, <span class='object_link'><a href="Base.html#model_class-instance_method" title="Compony::ModelFields::Base#model_class (method)">#model_class</a></span>, <span class='object_link'><a href="Base.html#name-instance_method" title="Compony::ModelFields::Base#name (method)">#name</a></span>, <span class='object_link'><a href="Base.html#schema_key-instance_method" title="Compony::ModelFields::Base#schema_key (method)">#schema_key</a></span></p>
123
+
124
+
125
+
126
+ <h2>
127
+ Instance Method Summary
128
+ <small><a href="#" class="summary_toggle">collapse</a></small>
129
+ </h2>
130
+
131
+ <ul class="summary">
132
+
133
+ <li class="public ">
134
+ <span class="summary_signature">
135
+
136
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong> &#x21d2; Association </a>
137
+
138
+
139
+
140
+ </span>
141
+
142
+
143
+ <span class="note title constructor">constructor</span>
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+ <span class="summary_desc"><div class='inline'>
153
+ <p>A new instance of Association.</p>
154
+ </div></span>
155
+
156
+ </li>
157
+
158
+
159
+ <li class="protected ">
160
+ <span class="summary_signature">
161
+
162
+ <a href="#resolve_association!-instance_method" title="#resolve_association! (instance method)">#<strong>resolve_association!</strong> &#x21d2; Object </a>
163
+
164
+
165
+
166
+ </span>
167
+
168
+
169
+
170
+ <span class="note title protected">protected</span>
171
+
172
+
173
+
174
+
175
+
176
+ <span class="summary_desc"><div class='inline'>
177
+ <p>Uses Rails methods to figure out the arity, schema key etc.</p>
178
+ </div></span>
179
+
180
+ </li>
181
+
182
+
183
+ <li class="public ">
184
+ <span class="summary_signature">
185
+
186
+ <a href="#schema_line-instance_method" title="#schema_line (instance method)">#<strong>schema_line</strong> &#x21d2; Object </a>
187
+
188
+
189
+
190
+ </span>
191
+
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+ <span class="summary_desc"><div class='inline'></div></span>
201
+
202
+ </li>
203
+
204
+
205
+ <li class="public ">
206
+ <span class="summary_signature">
207
+
208
+ <a href="#simpleform_input-instance_method" title="#simpleform_input (instance method)">#<strong>simpleform_input</strong>(form, _component, name: nil, **input_opts) &#x21d2; Object </a>
209
+
210
+
211
+
212
+ </span>
213
+
214
+
215
+
216
+
217
+
218
+
219
+
220
+
221
+
222
+ <span class="summary_desc"><div class='inline'></div></span>
223
+
224
+ </li>
225
+
226
+
227
+ <li class="public ">
228
+ <span class="summary_signature">
229
+
230
+ <a href="#simpleform_input_hidden-instance_method" title="#simpleform_input_hidden (instance method)">#<strong>simpleform_input_hidden</strong>(form, _component, name: nil, **input_opts) &#x21d2; Object </a>
231
+
232
+
233
+
234
+ </span>
235
+
236
+
237
+
238
+
239
+
240
+
241
+
242
+
243
+
244
+ <span class="summary_desc"><div class='inline'></div></span>
245
+
246
+ </li>
247
+
248
+
249
+ <li class="public ">
250
+ <span class="summary_signature">
251
+
252
+ <a href="#value_for-instance_method" title="#value_for (instance method)">#<strong>value_for</strong>(data, link_to_component: nil, link_opts: {}, controller: nil, **_) &#x21d2; Object </a>
253
+
254
+
255
+
256
+ </span>
257
+
258
+
259
+
260
+
261
+
262
+
263
+
264
+
265
+
266
+ <span class="summary_desc"><div class='inline'></div></span>
267
+
268
+ </li>
269
+
270
+
271
+ </ul>
272
+
273
+
274
+
275
+
276
+
277
+
278
+
279
+
280
+
281
+
282
+
283
+ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="Base.html" title="Compony::ModelFields::Base (class)">Base</a></span></h3>
284
+ <p class="inherited"><span class='object_link'><a href="Base.html#association%3F-instance_method" title="Compony::ModelFields::Base#association? (method)">#association?</a></span>, <span class='object_link'><a href="Base.html#label-instance_method" title="Compony::ModelFields::Base#label (method)">#label</a></span>, <span class='object_link'><a href="Base.html#multi%3F-instance_method" title="Compony::ModelFields::Base#multi? (method)">#multi?</a></span>, <span class='object_link'><a href="Base.html#transform_and_join-instance_method" title="Compony::ModelFields::Base#transform_and_join (method)">#transform_and_join</a></span></p>
285
+ <div id="constructor_details" class="method_details_list">
286
+ <h2>Constructor Details</h2>
287
+
288
+ <div class="method_details first">
289
+ <h3 class="signature first" id="initialize-instance_method">
290
+
291
+ #<strong>initialize</strong> &#x21d2; <tt><span class='object_link'><a href="" title="Compony::ModelFields::Association (class)">Association</a></span></tt>
292
+
293
+
294
+
295
+
296
+
297
+ </h3><div class="docstring">
298
+ <div class="discussion">
299
+
300
+ <p>Returns a new instance of Association.</p>
301
+
302
+
303
+ </div>
304
+ </div>
305
+ <div class="tags">
306
+
307
+
308
+ </div><table class="source_code">
309
+ <tr>
310
+ <td>
311
+ <pre class="lines">
312
+
313
+
314
+ 4
315
+ 5
316
+ 6
317
+ 7</pre>
318
+ </td>
319
+ <td>
320
+ <pre class="code"><span class="info file"># File 'lib/compony/model_fields/association.rb', line 4</span>
321
+
322
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='op'>...</span><span class='rparen'>)</span>
323
+ <span class='kw'>super</span>
324
+ <span class='id identifier rubyid_resolve_association!'>resolve_association!</span>
325
+ <span class='kw'>end</span></pre>
326
+ </td>
327
+ </tr>
328
+ </table>
329
+ </div>
330
+
331
+ </div>
332
+
333
+
334
+ <div id="instance_method_details" class="method_details_list">
335
+ <h2>Instance Method Details</h2>
336
+
337
+
338
+ <div class="method_details first">
339
+ <h3 class="signature first" id="resolve_association!-instance_method">
340
+
341
+ #<strong>resolve_association!</strong> &#x21d2; <tt>Object</tt> <span class="extras">(protected)</span>
342
+
343
+
344
+
345
+
346
+
347
+ </h3><div class="docstring">
348
+ <div class="discussion">
349
+
350
+ <p>Uses Rails methods to figure out the arity, schema key etc. and store them. This can be auto-inferred without accessing the database.</p>
351
+
352
+
353
+ </div>
354
+ </div>
355
+ <div class="tags">
356
+
357
+
358
+ </div><table class="source_code">
359
+ <tr>
360
+ <td>
361
+ <pre class="lines">
362
+
363
+
364
+ 58
365
+ 59
366
+ 60
367
+ 61
368
+ 62
369
+ 63
370
+ 64</pre>
371
+ </td>
372
+ <td>
373
+ <pre class="code"><span class="info file"># File 'lib/compony/model_fields/association.rb', line 58</span>
374
+
375
+ <span class='kw'>def</span> <span class='id identifier rubyid_resolve_association!'>resolve_association!</span>
376
+ <span class='ivar'>@association</span> <span class='op'>=</span> <span class='kw'>true</span>
377
+ <span class='id identifier rubyid_association_info'>association_info</span> <span class='op'>=</span> <span class='ivar'>@model_class</span><span class='period'>.</span><span class='id identifier rubyid_reflect_on_association'>reflect_on_association</span><span class='lparen'>(</span><span class='ivar'>@name</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_fail'>fail</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Association </span><span class='embexpr_beg'>#{</span><span class='ivar'>@name</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'> does not exist for </span><span class='embexpr_beg'>#{</span><span class='ivar'>@model_class</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_content'>.</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
378
+ <span class='ivar'>@multi</span> <span class='op'>=</span> <span class='id identifier rubyid_association_info'>association_info</span><span class='period'>.</span><span class='id identifier rubyid_macro'>macro</span> <span class='op'>==</span> <span class='symbol'>:has_many</span>
379
+ <span class='id identifier rubyid_id_name'>id_name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='ivar'>@name</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_singularize'>singularize</span><span class='embexpr_end'>}</span><span class='tstring_content'>_id</span><span class='tstring_end'>&quot;</span></span>
380
+ <span class='ivar'>@schema_key</span> <span class='op'>=</span> <span class='ivar'>@multi</span> <span class='op'>?</span> <span class='id identifier rubyid_id_name'>id_name</span><span class='period'>.</span><span class='id identifier rubyid_pluralize'>pluralize</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span> <span class='op'>:</span> <span class='id identifier rubyid_id_name'>id_name</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
381
+ <span class='kw'>end</span></pre>
382
+ </td>
383
+ </tr>
384
+ </table>
385
+ </div>
386
+
387
+ <div class="method_details ">
388
+ <h3 class="signature " id="schema_line-instance_method">
389
+
390
+ #<strong>schema_line</strong> &#x21d2; <tt>Object</tt>
391
+
392
+
393
+
394
+
395
+
396
+ </h3><div class="docstring">
397
+ <div class="discussion">
398
+
399
+
400
+ </div>
401
+ </div>
402
+ <div class="tags">
403
+
404
+
405
+ </div><table class="source_code">
406
+ <tr>
407
+ <td>
408
+ <pre class="lines">
409
+
410
+
411
+ 25
412
+ 26
413
+ 27
414
+ 28
415
+ 29
416
+ 30
417
+ 31
418
+ 32
419
+ 33
420
+ 34
421
+ 35
422
+ 36
423
+ 37
424
+ 38
425
+ 39
426
+ 40
427
+ 41
428
+ 42
429
+ 43
430
+ 44</pre>
431
+ </td>
432
+ <td>
433
+ <pre class="code"><span class="info file"># File 'lib/compony/model_fields/association.rb', line 25</span>
434
+
435
+ <span class='kw'>def</span> <span class='id identifier rubyid_schema_line'>schema_line</span>
436
+ <span class='id identifier rubyid_local_schema_key'>local_schema_key</span> <span class='op'>=</span> <span class='ivar'>@schema_key</span> <span class='comment'># Capture schema_key as it will not be available within the lambda
437
+ </span> <span class='kw'>if</span> <span class='id identifier rubyid_multi?'>multi?</span>
438
+ <span class='kw'>return</span> <span class='id identifier rubyid_proc'>proc</span> <span class='kw'>do</span>
439
+ <span class='id identifier rubyid_ary?'>ary?</span> <span class='id identifier rubyid_local_schema_key'>local_schema_key</span> <span class='kw'>do</span>
440
+ <span class='id identifier rubyid_list'>list</span> <span class='symbol'>:any_of</span> <span class='kw'>do</span>
441
+ <span class='id identifier rubyid_int'>int</span> <span class='label'>cast_str:</span> <span class='kw'>true</span>
442
+ <span class='id identifier rubyid_str'>str</span>
443
+ <span class='kw'>end</span>
444
+ <span class='kw'>end</span>
445
+ <span class='kw'>end</span>
446
+ <span class='kw'>else</span>
447
+ <span class='kw'>return</span> <span class='id identifier rubyid_proc'>proc</span> <span class='kw'>do</span>
448
+ <span class='id identifier rubyid_any_of?'>any_of?</span> <span class='id identifier rubyid_local_schema_key'>local_schema_key</span> <span class='kw'>do</span>
449
+ <span class='id identifier rubyid_str'>str</span>
450
+ <span class='id identifier rubyid_int'>int</span> <span class='label'>cast_str:</span> <span class='kw'>true</span>
451
+ <span class='kw'>end</span>
452
+ <span class='kw'>end</span>
453
+ <span class='kw'>end</span>
454
+ <span class='kw'>end</span></pre>
455
+ </td>
456
+ </tr>
457
+ </table>
458
+ </div>
459
+
460
+ <div class="method_details ">
461
+ <h3 class="signature " id="simpleform_input-instance_method">
462
+
463
+ #<strong>simpleform_input</strong>(form, _component, name: nil, **input_opts) &#x21d2; <tt>Object</tt>
464
+
465
+
466
+
467
+
468
+
469
+ </h3><div class="docstring">
470
+ <div class="discussion">
471
+
472
+
473
+ </div>
474
+ </div>
475
+ <div class="tags">
476
+
477
+
478
+ </div><table class="source_code">
479
+ <tr>
480
+ <td>
481
+ <pre class="lines">
482
+
483
+
484
+ 46
485
+ 47
486
+ 48</pre>
487
+ </td>
488
+ <td>
489
+ <pre class="code"><span class="info file"># File 'lib/compony/model_fields/association.rb', line 46</span>
490
+
491
+ <span class='kw'>def</span> <span class='id identifier rubyid_simpleform_input'>simpleform_input</span><span class='lparen'>(</span><span class='id identifier rubyid_form'>form</span><span class='comma'>,</span> <span class='id identifier rubyid__component'>_component</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_input_opts'>input_opts</span><span class='rparen'>)</span>
492
+ <span class='kw'>return</span> <span class='id identifier rubyid_form'>form</span><span class='period'>.</span><span class='id identifier rubyid_association'>association</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>||</span> <span class='ivar'>@name</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_input_opts'>input_opts</span>
493
+ <span class='kw'>end</span></pre>
494
+ </td>
495
+ </tr>
496
+ </table>
497
+ </div>
498
+
499
+ <div class="method_details ">
500
+ <h3 class="signature " id="simpleform_input_hidden-instance_method">
501
+
502
+ #<strong>simpleform_input_hidden</strong>(form, _component, name: nil, **input_opts) &#x21d2; <tt>Object</tt>
503
+
504
+
505
+
506
+
507
+
508
+ </h3><div class="docstring">
509
+ <div class="discussion">
510
+
511
+
512
+ </div>
513
+ </div>
514
+ <div class="tags">
515
+
516
+
517
+ </div><table class="source_code">
518
+ <tr>
519
+ <td>
520
+ <pre class="lines">
521
+
522
+
523
+ 50
524
+ 51
525
+ 52</pre>
526
+ </td>
527
+ <td>
528
+ <pre class="code"><span class="info file"># File 'lib/compony/model_fields/association.rb', line 50</span>
529
+
530
+ <span class='kw'>def</span> <span class='id identifier rubyid_simpleform_input_hidden'>simpleform_input_hidden</span><span class='lparen'>(</span><span class='id identifier rubyid_form'>form</span><span class='comma'>,</span> <span class='id identifier rubyid__component'>_component</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_input_opts'>input_opts</span><span class='rparen'>)</span>
531
+ <span class='kw'>return</span> <span class='id identifier rubyid_form'>form</span><span class='period'>.</span><span class='id identifier rubyid_input'>input</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>||</span> <span class='ivar'>@schema_key</span><span class='comma'>,</span> <span class='label'>as:</span> <span class='symbol'>:hidden</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_input_opts'>input_opts</span>
532
+ <span class='kw'>end</span></pre>
533
+ </td>
534
+ </tr>
535
+ </table>
536
+ </div>
537
+
538
+ <div class="method_details ">
539
+ <h3 class="signature " id="value_for-instance_method">
540
+
541
+ #<strong>value_for</strong>(data, link_to_component: nil, link_opts: {}, controller: nil, **_) &#x21d2; <tt>Object</tt>
542
+
543
+
544
+
545
+
546
+
547
+ </h3><div class="docstring">
548
+ <div class="discussion">
549
+
550
+
551
+ </div>
552
+ </div>
553
+ <div class="tags">
554
+
555
+
556
+ </div><table class="source_code">
557
+ <tr>
558
+ <td>
559
+ <pre class="lines">
560
+
561
+
562
+ 9
563
+ 10
564
+ 11
565
+ 12
566
+ 13
567
+ 14
568
+ 15
569
+ 16
570
+ 17
571
+ 18
572
+ 19
573
+ 20
574
+ 21
575
+ 22
576
+ 23</pre>
577
+ </td>
578
+ <td>
579
+ <pre class="code"><span class="info file"># File 'lib/compony/model_fields/association.rb', line 9</span>
580
+
581
+ <span class='kw'>def</span> <span class='id identifier rubyid_value_for'>value_for</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='label'>link_to_component:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>link_opts:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='label'>controller:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid__'>_</span><span class='rparen'>)</span>
582
+ <span class='kw'>if</span> <span class='id identifier rubyid_link_to_component'>link_to_component</span>
583
+ <span class='id identifier rubyid_fail'>fail</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Must pass controller if link_to_component is given.</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_controller'>controller</span>
584
+ <span class='kw'>return</span> <span class='id identifier rubyid_transform_and_join'>transform_and_join</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='ivar'>@name</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='label'>controller:</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_el'>el</span><span class='op'>|</span>
585
+ <span class='kw'>next</span> <span class='kw'>nil</span> <span class='kw'>if</span> <span class='id identifier rubyid_el'>el</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
586
+ <span class='kw'>if</span> <span class='const'><span class='object_link'><a href="../../Compony.html" title="Compony (module)">Compony</a></span></span><span class='period'>.</span><span class='id identifier rubyid_comp_class_for'><span class='object_link'><a href="../../Compony.html#comp_class_for-class_method" title="Compony.comp_class_for (method)">comp_class_for</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_link_to_component'>link_to_component</span><span class='comma'>,</span> <span class='id identifier rubyid_el'>el</span><span class='rparen'>)</span>
587
+ <span class='kw'>next</span> <span class='id identifier rubyid_controller'>controller</span><span class='period'>.</span><span class='id identifier rubyid_helpers'>helpers</span><span class='period'>.</span><span class='id identifier rubyid_compony_link'>compony_link</span><span class='lparen'>(</span><span class='id identifier rubyid_link_to_component'>link_to_component</span><span class='comma'>,</span> <span class='id identifier rubyid_el'>el</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_link_opts'>link_opts</span><span class='rparen'>)</span>
588
+ <span class='kw'>else</span>
589
+ <span class='kw'>next</span> <span class='id identifier rubyid_el'>el</span><span class='period'>.</span><span class='id identifier rubyid_label'>label</span>
590
+ <span class='kw'>end</span>
591
+ <span class='kw'>end</span>
592
+ <span class='kw'>else</span>
593
+ <span class='kw'>return</span> <span class='id identifier rubyid_transform_and_join'>transform_and_join</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='ivar'>@name</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='label'>controller:</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_el'>el</span><span class='op'>|</span> <span class='id identifier rubyid_el'>el</span><span class='op'>&amp;.</span><span class='id identifier rubyid_label'>label</span> <span class='rbrace'>}</span>
594
+ <span class='kw'>end</span>
595
+ <span class='kw'>end</span></pre>
596
+ </td>
597
+ </tr>
598
+ </table>
599
+ </div>
600
+
601
+ </div>
602
+
603
+ </div>
604
+
605
+ <div id="footer">
606
+ Generated on Wed Apr 24 17:14:06 2024 by
607
+ <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
608
+ 0.9.34 (ruby-3.2.2).
609
+ </div>
610
+
611
+ </div>
612
+ </body>
613
+ </html>