compony 0.5.3 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +6 -6
- data/README.md +36 -0
- data/VERSION +1 -1
- data/app/controllers/compony_controller.rb +4 -0
- data/compony.gemspec +4 -4
- 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 +96 -27
- 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/Button.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 +210 -127
- data/doc/Compony/Components/New.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/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 +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 +25 -25
- 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.html +3 -3
- data/doc/ComponyController.html +1 -1
- data/doc/_index.html +1 -1
- data/doc/file.README.html +36 -1
- data/doc/index.html +36 -1
- data/doc/method_list.html +112 -96
- data/doc/top-level-namespace.html +1 -1
- data/lib/compony/component_mixins/default/standalone/standalone_dsl.rb +18 -10
- data/lib/compony/components/form.rb +49 -32
- data/lib/compony/model_mixin.rb +19 -13
- data/lib/compony.rb +2 -2
- metadata +3 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cf3e8e8a9553f25116f289ac4c8531d7823b5b5214a6ebaffe989f0d33dcbf7
|
4
|
+
data.tar.gz: b43e5e44b51a3d348eba5944217446cd6f94bcdb7a5c254d7dbb5f1678f0943a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22a6a74628fbba5d419474cd44f4247766b0b7552ed37e61d57b13911722aa53c19fa943ffd4dcf7cfd4c88be039f0bb10a9042eb0c6b818e6da7ec0307f88e0
|
7
|
+
data.tar.gz: f9e19e419e1c92a0ddf77c97ddb5f11c79fb0fc664ab8983d4420fda70c124af1a82640f70074feffefb322994e4b1adbcbd98a9b9f53bac86117fa0d7382706
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# 0.5.4
|
2
|
+
|
3
|
+
- Fix a failure description in Form
|
4
|
+
- Support `multilang: true` in `ModelMixin`'s and `Form`'s `field` call, as well as in `Form`'s `schema_field`
|
5
|
+
- Allow customizing parameters for form builder
|
6
|
+
- Implement `skip_forgery_protection!`
|
7
|
+
|
1
8
|
# 0.5.3
|
2
9
|
|
3
10
|
- Support `standalone_name` in `Compony.button` and `compony_link`
|
data/Gemfile.lock
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
compony (0.4.
|
5
|
-
anchormodel (~> 0.2.
|
4
|
+
compony (0.5.4.edge)
|
5
|
+
anchormodel (~> 0.2.1)
|
6
6
|
cancancan (~> 3.6.1)
|
7
7
|
dslblend (>= 0.0.3)
|
8
8
|
dyny (>= 0.0.3)
|
9
9
|
rails (>= 7.2.1)
|
10
|
-
request_store (>= 1.
|
10
|
+
request_store (>= 1.7)
|
11
11
|
schemacop (>= 3.0.17)
|
12
|
-
simple_form (>= 5.1
|
12
|
+
simple_form (>= 5.3.1)
|
13
13
|
|
14
14
|
GEM
|
15
15
|
remote: https://rubygems.org/
|
@@ -186,7 +186,7 @@ GEM
|
|
186
186
|
regexp_parser (2.8.0)
|
187
187
|
reline (0.5.10)
|
188
188
|
io-console (~> 0.5)
|
189
|
-
request_store (1.
|
189
|
+
request_store (1.7.0)
|
190
190
|
rack (>= 1.4)
|
191
191
|
rexml (3.2.5)
|
192
192
|
rubocop (1.51.0)
|
@@ -211,7 +211,7 @@ GEM
|
|
211
211
|
activesupport (>= 4.0)
|
212
212
|
ruby2_keywords (= 0.0.4)
|
213
213
|
securerandom (0.3.1)
|
214
|
-
simple_form (5.
|
214
|
+
simple_form (5.3.1)
|
215
215
|
actionpack (>= 5.2)
|
216
216
|
activemodel (>= 5.2)
|
217
217
|
stringio (3.0.9)
|
data/README.md
CHANGED
@@ -583,6 +583,7 @@ The standalone DSL has more features than those presented in the minimal example
|
|
583
583
|
|
584
584
|
- `standalone` can be called multiple times, for components that need to expose multiple paths, as described below. Inside each `standalone` call, you can call:
|
585
585
|
- `skip_authentication!` which disables authentication, in case you provided some. You need to implement `authorize` regardless.
|
586
|
+
- `skip_forgery_protection!` which disables CSRF protection for the controller action generated for this standalone configuration.
|
586
587
|
- `layout` which takes the file name of a Rails layout and defaults to `layouts/application`. Use this to have your Rails application look differently depending on the component.
|
587
588
|
- `verb` which takes an HTTP verb as a symbol, one of: `%i[get head post put delete connect options trace patch]`. `verb` can be called up to once per verb. Inside each `verb` call, you can call (in the non-resourceful case):
|
588
589
|
- `authorize` is mandatory and explained above.
|
@@ -1418,6 +1419,41 @@ class Ability
|
|
1418
1419
|
cannot :set_password, User # This prohibits setting and changing passwords of any user
|
1419
1420
|
```
|
1420
1421
|
|
1422
|
+
#### Dealing with multilingual fields
|
1423
|
+
|
1424
|
+
When using Gems such as `mobility`, Compony provides support for multilingual fields. For instance, assuming that a model has the attribute `label` translated in English and German, making `label` a virtual attribute reading either `label_en` and `label_de`, depending on the user's language, Compony automatically generates a multilingual field if the following is used:
|
1425
|
+
|
1426
|
+
In the model:
|
1427
|
+
|
1428
|
+
```ruby
|
1429
|
+
class Foo < ApplicationRecord
|
1430
|
+
# No need to write:
|
1431
|
+
field :label, :string, virtual: true
|
1432
|
+
I18n.available_locales.each do |locale|
|
1433
|
+
field :"label_#{locale}", :string
|
1434
|
+
end
|
1435
|
+
|
1436
|
+
# Instead, write this, which is equivalent:
|
1437
|
+
field :label, :string, multilang: true
|
1438
|
+
end
|
1439
|
+
```
|
1440
|
+
|
1441
|
+
In the same mindset, you can simplify your form as follows to generate one input per language:
|
1442
|
+
|
1443
|
+
```ruby
|
1444
|
+
class Components::Foos::Form < Compony::Components::Form
|
1445
|
+
setup do
|
1446
|
+
form_fields do
|
1447
|
+
# Since `field` only generates an input, you must loop over them and render them as you wish, e.g. with "concat":
|
1448
|
+
field(:label, multilang: true).each { |inp| concat inp }
|
1449
|
+
end
|
1450
|
+
|
1451
|
+
# Don't forget to mark `schema_field` as multilingual as well, which will accept label_en and label_de:
|
1452
|
+
schema_field :label, multilang: true
|
1453
|
+
end
|
1454
|
+
end
|
1455
|
+
```
|
1456
|
+
|
1421
1457
|
### New
|
1422
1458
|
|
1423
1459
|
This component is the Compony equivalent to a typical Rails controller's `new` and `create` actions.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.4
|
@@ -1,6 +1,7 @@
|
|
1
1
|
class ComponyController < ApplicationController
|
2
2
|
# Init
|
3
3
|
actions_without_authentication = []
|
4
|
+
actions_without_forgery_protection = []
|
4
5
|
|
5
6
|
# Define a controller action for each route
|
6
7
|
Components.constants.each do |family_cst|
|
@@ -23,6 +24,7 @@ class ComponyController < ApplicationController
|
|
23
24
|
|
24
25
|
# Disable authentication for marked standalone configs
|
25
26
|
actions_without_authentication << standalone_config.rails_action_name.to_sym if standalone_config.skip_authentication
|
27
|
+
actions_without_forgery_protection << standalone_config.rails_action_name.to_sym if standalone_config.skip_forgery_protection
|
26
28
|
end
|
27
29
|
end
|
28
30
|
end
|
@@ -30,4 +32,6 @@ class ComponyController < ApplicationController
|
|
30
32
|
if Compony.authentication_before_action.present?
|
31
33
|
before_action Compony.authentication_before_action, except: actions_without_authentication
|
32
34
|
end
|
35
|
+
|
36
|
+
skip_forgery_protection only: actions_without_forgery_protection
|
33
37
|
end
|
data/compony.gemspec
CHANGED
@@ -2,19 +2,19 @@
|
|
2
2
|
# This file is auto-generated via: 'rake gemspec'.
|
3
3
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: compony 0.5.
|
5
|
+
# stub: compony 0.5.4 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "compony".freeze
|
9
|
-
s.version = "0.5.
|
9
|
+
s.version = "0.5.4".freeze
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["Sandro Kalbermatter".freeze, "contributors".freeze]
|
14
|
-
s.date = "
|
14
|
+
s.date = "2025-02-14"
|
15
15
|
s.files = [".gitignore".freeze, ".ruby-version".freeze, ".yardopts".freeze, "CHANGELOG.md".freeze, "Gemfile".freeze, "Gemfile.lock".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "TODO.md".freeze, "VERSION".freeze, "app/controllers/compony_controller.rb".freeze, "compony.gemspec".freeze, "config/locales/de.yml".freeze, "config/locales/en.yml".freeze, "config/locales/fr.yml".freeze, "config/routes.rb".freeze, "doc/ComponentGenerator.html".freeze, "doc/Components.html".freeze, "doc/ComponentsGenerator.html".freeze, "doc/Compony.html".freeze, "doc/Compony/Component.html".freeze, "doc/Compony/ComponentMixins.html".freeze, "doc/Compony/ComponentMixins/Default.html".freeze, "doc/Compony/ComponentMixins/Default/Labelling.html".freeze, "doc/Compony/ComponentMixins/Default/Standalone.html".freeze, "doc/Compony/ComponentMixins/Default/Standalone/ResourcefulVerbDsl.html".freeze, "doc/Compony/ComponentMixins/Default/Standalone/StandaloneDsl.html".freeze, "doc/Compony/ComponentMixins/Default/Standalone/VerbDsl.html".freeze, "doc/Compony/ComponentMixins/Resourceful.html".freeze, "doc/Compony/Components.html".freeze, "doc/Compony/Components/Button.html".freeze, "doc/Compony/Components/Destroy.html".freeze, "doc/Compony/Components/Edit.html".freeze, "doc/Compony/Components/Form.html".freeze, "doc/Compony/Components/New.html".freeze, "doc/Compony/Components/WithForm.html".freeze, "doc/Compony/ControllerMixin.html".freeze, "doc/Compony/Engine.html".freeze, "doc/Compony/MethodAccessibleHash.html".freeze, "doc/Compony/ModelFields.html".freeze, "doc/Compony/ModelFields/Anchormodel.html".freeze, "doc/Compony/ModelFields/Association.html".freeze, "doc/Compony/ModelFields/Attachment.html".freeze, "doc/Compony/ModelFields/Base.html".freeze, "doc/Compony/ModelFields/Boolean.html".freeze, "doc/Compony/ModelFields/Color.html".freeze, "doc/Compony/ModelFields/Currency.html".freeze, "doc/Compony/ModelFields/Date.html".freeze, "doc/Compony/ModelFields/Datetime.html".freeze, "doc/Compony/ModelFields/Decimal.html".freeze, "doc/Compony/ModelFields/Email.html".freeze, "doc/Compony/ModelFields/Float.html".freeze, "doc/Compony/ModelFields/Integer.html".freeze, "doc/Compony/ModelFields/Percentage.html".freeze, "doc/Compony/ModelFields/Phone.html".freeze, "doc/Compony/ModelFields/RichText.html".freeze, "doc/Compony/ModelFields/String.html".freeze, "doc/Compony/ModelFields/Text.html".freeze, "doc/Compony/ModelFields/Time.html".freeze, "doc/Compony/ModelFields/Url.html".freeze, "doc/Compony/ModelMixin.html".freeze, "doc/Compony/NaturalOrdering.html".freeze, "doc/Compony/RequestContext.html".freeze, "doc/Compony/Version.html".freeze, "doc/Compony/ViewHelpers.html".freeze, "doc/ComponyController.html".freeze, "doc/_index.html".freeze, "doc/class_list.html".freeze, "doc/css/common.css".freeze, "doc/css/full_list.css".freeze, "doc/css/style.css".freeze, "doc/file.README.html".freeze, "doc/file_list.html".freeze, "doc/frames.html".freeze, "doc/imgs/intro-example-destroy.png".freeze, "doc/imgs/intro-example-edit.png".freeze, "doc/imgs/intro-example-index.png".freeze, "doc/imgs/intro-example-new.png".freeze, "doc/imgs/intro-example-show.png".freeze, "doc/index.html".freeze, "doc/js/app.js".freeze, "doc/js/full_list.js".freeze, "doc/js/jquery.js".freeze, "doc/method_list.html".freeze, "doc/resourceful_lifecycle.graphml".freeze, "doc/resourceful_lifecycle.pdf".freeze, "doc/resourceful_lifecycle.png".freeze, "doc/top-level-namespace.html".freeze, "lib/compony.rb".freeze, "lib/compony/component.rb".freeze, "lib/compony/component_mixins/default/labelling.rb".freeze, "lib/compony/component_mixins/default/standalone.rb".freeze, "lib/compony/component_mixins/default/standalone/resourceful_verb_dsl.rb".freeze, "lib/compony/component_mixins/default/standalone/standalone_dsl.rb".freeze, "lib/compony/component_mixins/default/standalone/verb_dsl.rb".freeze, "lib/compony/component_mixins/resourceful.rb".freeze, "lib/compony/components/button.rb".freeze, "lib/compony/components/destroy.rb".freeze, "lib/compony/components/edit.rb".freeze, "lib/compony/components/form.rb".freeze, "lib/compony/components/new.rb".freeze, "lib/compony/components/with_form.rb".freeze, "lib/compony/controller_mixin.rb".freeze, "lib/compony/engine.rb".freeze, "lib/compony/method_accessible_hash.rb".freeze, "lib/compony/model_fields/anchormodel.rb".freeze, "lib/compony/model_fields/association.rb".freeze, "lib/compony/model_fields/attachment.rb".freeze, "lib/compony/model_fields/base.rb".freeze, "lib/compony/model_fields/boolean.rb".freeze, "lib/compony/model_fields/color.rb".freeze, "lib/compony/model_fields/currency.rb".freeze, "lib/compony/model_fields/date.rb".freeze, "lib/compony/model_fields/datetime.rb".freeze, "lib/compony/model_fields/decimal.rb".freeze, "lib/compony/model_fields/email.rb".freeze, "lib/compony/model_fields/float.rb".freeze, "lib/compony/model_fields/integer.rb".freeze, "lib/compony/model_fields/percentage.rb".freeze, "lib/compony/model_fields/phone.rb".freeze, "lib/compony/model_fields/rich_text.rb".freeze, "lib/compony/model_fields/string.rb".freeze, "lib/compony/model_fields/text.rb".freeze, "lib/compony/model_fields/time.rb".freeze, "lib/compony/model_fields/url.rb".freeze, "lib/compony/model_mixin.rb".freeze, "lib/compony/natural_ordering.rb".freeze, "lib/compony/request_context.rb".freeze, "lib/compony/version.rb".freeze, "lib/compony/view_helpers.rb".freeze, "lib/generators/component/USAGE".freeze, "lib/generators/component/component_generator.rb".freeze, "lib/generators/component/templates/component.rb.erb".freeze, "lib/generators/component/templates/destroy.rb.erb".freeze, "lib/generators/component/templates/edit.rb.erb".freeze, "lib/generators/component/templates/form.rb.erb".freeze, "lib/generators/component/templates/new.rb.erb".freeze, "lib/generators/components/USAGE".freeze, "lib/generators/components/components_generator.rb".freeze, "logo.svg".freeze]
|
16
16
|
s.required_ruby_version = Gem::Requirement.new(">= 3.3.5".freeze)
|
17
|
-
s.rubygems_version = "3.
|
17
|
+
s.rubygems_version = "3.6.3".freeze
|
18
18
|
s.summary = "Compony is a Gem that allows you to write your Rails application in component-style fashion. It combines a controller action and route along \\ with its view into a single Ruby class. This allows writing much DRYer code, using inheritance even in views and much easier refactoring for your Rails \\ applications, helping you to keep the code clean as the application evolves.".freeze
|
19
19
|
|
20
20
|
s.specification_version = 4
|
data/doc/ComponentGenerator.html
CHANGED
@@ -221,7 +221,7 @@
|
|
221
221
|
</div>
|
222
222
|
|
223
223
|
<div id="footer">
|
224
|
-
Generated on Fri
|
224
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
225
225
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
226
226
|
0.9.37 (ruby-3.3.5).
|
227
227
|
</div>
|
data/doc/Components.html
CHANGED
@@ -193,7 +193,7 @@
|
|
193
193
|
</div>
|
194
194
|
|
195
195
|
<div id="footer">
|
196
|
-
Generated on Fri
|
196
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
197
197
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
198
198
|
0.9.37 (ruby-3.3.5).
|
199
199
|
</div>
|
data/doc/Compony/Component.html
CHANGED
@@ -2503,7 +2503,7 @@
|
|
2503
2503
|
</div>
|
2504
2504
|
|
2505
2505
|
<div id="footer">
|
2506
|
-
Generated on Fri
|
2506
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
2507
2507
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
2508
2508
|
0.9.37 (ruby-3.3.5).
|
2509
2509
|
</div>
|
@@ -396,7 +396,7 @@
|
|
396
396
|
</div>
|
397
397
|
|
398
398
|
<div id="footer">
|
399
|
-
Generated on Fri
|
399
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
400
400
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
401
401
|
0.9.37 (ruby-3.3.5).
|
402
402
|
</div>
|
@@ -529,7 +529,7 @@
|
|
529
529
|
</div>
|
530
530
|
|
531
531
|
<div id="footer">
|
532
|
-
Generated on Fri
|
532
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
533
533
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
534
534
|
0.9.37 (ruby-3.3.5).
|
535
535
|
</div>
|
@@ -198,6 +198,30 @@
|
|
198
198
|
<p>DSL Defines that for this component, no authentication should be performed.</p>
|
199
199
|
</div></span>
|
200
200
|
|
201
|
+
</li>
|
202
|
+
|
203
|
+
|
204
|
+
<li class="protected ">
|
205
|
+
<span class="summary_signature">
|
206
|
+
|
207
|
+
<a href="#skip_forgery_protection!-instance_method" title="#skip_forgery_protection! (instance method)">#<strong>skip_forgery_protection!</strong> ⇒ Object </a>
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
</span>
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
<span class="note title protected">protected</span>
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
<span class="summary_desc"><div class='inline'>
|
222
|
+
<p>DSL Defines that for this component, no forgery protection (CSRF) should be performed.</p>
|
223
|
+
</div></span>
|
224
|
+
|
201
225
|
</li>
|
202
226
|
|
203
227
|
|
@@ -294,7 +318,8 @@
|
|
294
318
|
18
|
295
319
|
19
|
296
320
|
20
|
297
|
-
21
|
321
|
+
21
|
322
|
+
22</pre>
|
298
323
|
</td>
|
299
324
|
<td>
|
300
325
|
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/standalone_dsl.rb', line 9</span>
|
@@ -310,6 +335,7 @@
|
|
310
335
|
<span class='ivar'>@scope_args</span> <span class='op'>=</span> <span class='id identifier rubyid_scope_args'>scope_args</span>
|
311
336
|
<span class='ivar'>@verbs</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
312
337
|
<span class='ivar'>@skip_authentication</span> <span class='op'>=</span> <span class='kw'>false</span>
|
338
|
+
<span class='ivar'>@skip_forgery_protection</span> <span class='op'>=</span> <span class='kw'>false</span>
|
313
339
|
<span class='ivar'>@layout</span> <span class='op'>=</span> <span class='kw'>true</span> <span class='comment'># can be overriden by false or a string
|
314
340
|
</span><span class='kw'>end</span></pre>
|
315
341
|
</td>
|
@@ -370,12 +396,12 @@
|
|
370
396
|
<pre class="lines">
|
371
397
|
|
372
398
|
|
373
|
-
|
374
|
-
|
375
|
-
|
399
|
+
80
|
400
|
+
81
|
401
|
+
82</pre>
|
376
402
|
</td>
|
377
403
|
<td>
|
378
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/standalone_dsl.rb', line
|
404
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/standalone_dsl.rb', line 80</span>
|
379
405
|
|
380
406
|
<span class='kw'>def</span> <span class='id identifier rubyid_layout'>layout</span><span class='lparen'>(</span><span class='id identifier rubyid_layout'>layout</span><span class='rparen'>)</span>
|
381
407
|
<span class='ivar'>@layout</span> <span class='op'>=</span> <span class='id identifier rubyid_layout'>layout</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
@@ -411,12 +437,12 @@
|
|
411
437
|
<pre class="lines">
|
412
438
|
|
413
439
|
|
414
|
-
|
415
|
-
|
416
|
-
|
440
|
+
66
|
441
|
+
67
|
442
|
+
68</pre>
|
417
443
|
</td>
|
418
444
|
<td>
|
419
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/standalone_dsl.rb', line
|
445
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/standalone_dsl.rb', line 66</span>
|
420
446
|
|
421
447
|
<span class='kw'>def</span> <span class='id identifier rubyid_skip_authentication!'>skip_authentication!</span>
|
422
448
|
<span class='ivar'>@skip_authentication</span> <span class='op'>=</span> <span class='kw'>true</span>
|
@@ -424,6 +450,47 @@
|
|
424
450
|
</td>
|
425
451
|
</tr>
|
426
452
|
</table>
|
453
|
+
</div>
|
454
|
+
|
455
|
+
<div class="method_details ">
|
456
|
+
<h3 class="signature " id="skip_forgery_protection!-instance_method">
|
457
|
+
|
458
|
+
#<strong>skip_forgery_protection!</strong> ⇒ <tt>Object</tt> <span class="extras">(protected)</span>
|
459
|
+
|
460
|
+
|
461
|
+
|
462
|
+
|
463
|
+
|
464
|
+
</h3><div class="docstring">
|
465
|
+
<div class="discussion">
|
466
|
+
|
467
|
+
<p>DSL Defines that for this component, no forgery protection (CSRF) should be performed.</p>
|
468
|
+
|
469
|
+
|
470
|
+
</div>
|
471
|
+
</div>
|
472
|
+
<div class="tags">
|
473
|
+
|
474
|
+
|
475
|
+
</div><table class="source_code">
|
476
|
+
<tr>
|
477
|
+
<td>
|
478
|
+
<pre class="lines">
|
479
|
+
|
480
|
+
|
481
|
+
72
|
482
|
+
73
|
483
|
+
74</pre>
|
484
|
+
</td>
|
485
|
+
<td>
|
486
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/standalone_dsl.rb', line 72</span>
|
487
|
+
|
488
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_skip_forgery_protection!'>skip_forgery_protection!</span>
|
489
|
+
<span class='ivar'>@skip_forgery_protection</span> <span class='op'>=</span> <span class='kw'>true</span>
|
490
|
+
<span class='kw'>end</span></pre>
|
491
|
+
</td>
|
492
|
+
</tr>
|
493
|
+
</table>
|
427
494
|
</div>
|
428
495
|
|
429
496
|
<div class="method_details ">
|
@@ -452,7 +519,6 @@
|
|
452
519
|
<pre class="lines">
|
453
520
|
|
454
521
|
|
455
|
-
24
|
456
522
|
25
|
457
523
|
26
|
458
524
|
27
|
@@ -467,25 +533,28 @@
|
|
467
533
|
36
|
468
534
|
37
|
469
535
|
38
|
470
|
-
39
|
536
|
+
39
|
537
|
+
40
|
538
|
+
41</pre>
|
471
539
|
</td>
|
472
540
|
<td>
|
473
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/standalone_dsl.rb', line
|
541
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/standalone_dsl.rb', line 25</span>
|
474
542
|
|
475
543
|
<span class='kw'>def</span> <span class='id identifier rubyid_to_conf'>to_conf</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
476
544
|
<span class='id identifier rubyid_evaluate'>evaluate</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
477
545
|
<span class='ivar'>@component</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_binding'>binding</span><span class='period'>.</span><span class='id identifier rubyid_eval'>eval</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>self</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='comment'># Fetches the component holding this DSL call (via the block)
|
478
546
|
</span> <span class='kw'>return</span> <span class='lbrace'>{</span>
|
479
|
-
<span class='label'>name:</span>
|
480
|
-
<span class='label'>path:</span>
|
481
|
-
<span class='label'>constraints:</span>
|
482
|
-
<span class='label'>scope:</span>
|
483
|
-
<span class='label'>scope_args:</span>
|
484
|
-
<span class='label'>verbs:</span>
|
485
|
-
<span class='label'>rails_action_name:</span>
|
486
|
-
<span class='label'>path_helper_name:</span>
|
487
|
-
<span class='label'>skip_authentication:</span>
|
488
|
-
<span class='label'>
|
547
|
+
<span class='label'>name:</span> <span class='ivar'>@name</span><span class='comma'>,</span>
|
548
|
+
<span class='label'>path:</span> <span class='ivar'>@path</span><span class='comma'>,</span>
|
549
|
+
<span class='label'>constraints:</span> <span class='ivar'>@constraints</span><span class='comma'>,</span>
|
550
|
+
<span class='label'>scope:</span> <span class='ivar'>@scope</span><span class='comma'>,</span>
|
551
|
+
<span class='label'>scope_args:</span> <span class='ivar'>@scope_args</span><span class='comma'>,</span>
|
552
|
+
<span class='label'>verbs:</span> <span class='ivar'>@verbs</span><span class='comma'>,</span>
|
553
|
+
<span class='label'>rails_action_name:</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_rails_action_name'><span class='object_link'><a href="../../../../Compony.html#rails_action_name-class_method" title="Compony.rails_action_name (method)">rails_action_name</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_comp_name'>comp_name</span><span class='comma'>,</span> <span class='id identifier rubyid_family_name'>family_name</span><span class='comma'>,</span> <span class='ivar'>@name</span><span class='rparen'>)</span><span class='comma'>,</span>
|
554
|
+
<span class='label'>path_helper_name:</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_path_helper_name'><span class='object_link'><a href="../../../../Compony.html#path_helper_name-class_method" title="Compony.path_helper_name (method)">path_helper_name</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_comp_name'>comp_name</span><span class='comma'>,</span> <span class='id identifier rubyid_family_name'>family_name</span><span class='comma'>,</span> <span class='ivar'>@name</span><span class='rparen'>)</span><span class='comma'>,</span>
|
555
|
+
<span class='label'>skip_authentication:</span> <span class='ivar'>@skip_authentication</span><span class='comma'>,</span>
|
556
|
+
<span class='label'>skip_forgery_protection:</span> <span class='ivar'>@skip_forgery_protection</span><span class='comma'>,</span>
|
557
|
+
<span class='label'>layout:</span> <span class='ivar'>@layout</span>
|
489
558
|
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span>
|
490
559
|
<span class='kw'>end</span></pre>
|
491
560
|
</td>
|
@@ -546,8 +615,6 @@
|
|
546
615
|
<pre class="lines">
|
547
616
|
|
548
617
|
|
549
|
-
46
|
550
|
-
47
|
551
618
|
48
|
552
619
|
49
|
553
620
|
50
|
@@ -560,10 +627,12 @@
|
|
560
627
|
57
|
561
628
|
58
|
562
629
|
59
|
563
|
-
60
|
630
|
+
60
|
631
|
+
61
|
632
|
+
62</pre>
|
564
633
|
</td>
|
565
634
|
<td>
|
566
|
-
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/standalone_dsl.rb', line
|
635
|
+
<pre class="code"><span class="info file"># File 'lib/compony/component_mixins/default/standalone/standalone_dsl.rb', line 48</span>
|
567
636
|
|
568
637
|
<span class='kw'>def</span> <span class='id identifier rubyid_verb'>verb</span><span class='lparen'>(</span><span class='id identifier rubyid_verb'>verb</span><span class='comma'>,</span> <span class='op'>*</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_nargs'>nargs</span><span class='comma'>,</span> <span class='op'>&</span><span class='rparen'>)</span>
|
569
638
|
<span class='id identifier rubyid_verb'>verb</span> <span class='op'>=</span> <span class='id identifier rubyid_verb'>verb</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
|
@@ -590,7 +659,7 @@
|
|
590
659
|
</div>
|
591
660
|
|
592
661
|
<div id="footer">
|
593
|
-
Generated on Fri
|
662
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
594
663
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
595
664
|
0.9.37 (ruby-3.3.5).
|
596
665
|
</div>
|
@@ -567,7 +567,7 @@
|
|
567
567
|
</div>
|
568
568
|
|
569
569
|
<div id="footer">
|
570
|
-
Generated on Fri
|
570
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
571
571
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
572
572
|
0.9.37 (ruby-3.3.5).
|
573
573
|
</div>
|
@@ -682,7 +682,7 @@
|
|
682
682
|
</div>
|
683
683
|
|
684
684
|
<div id="footer">
|
685
|
-
Generated on Fri
|
685
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
686
686
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
687
687
|
0.9.37 (ruby-3.3.5).
|
688
688
|
</div>
|
@@ -116,7 +116,7 @@
|
|
116
116
|
</div>
|
117
117
|
|
118
118
|
<div id="footer">
|
119
|
-
Generated on Fri
|
119
|
+
Generated on Fri Feb 14 13:24:11 2025 by
|
120
120
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
121
121
|
0.9.37 (ruby-3.3.5).
|
122
122
|
</div>
|
@@ -1183,7 +1183,7 @@
|
|
1183
1183
|
</div>
|
1184
1184
|
|
1185
1185
|
<div id="footer">
|
1186
|
-
Generated on Fri
|
1186
|
+
Generated on Fri Feb 14 13:24:11 2025 by
|
1187
1187
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1188
1188
|
0.9.37 (ruby-3.3.5).
|
1189
1189
|
</div>
|
@@ -116,7 +116,7 @@
|
|
116
116
|
</div>
|
117
117
|
|
118
118
|
<div id="footer">
|
119
|
-
Generated on Fri
|
119
|
+
Generated on Fri Feb 14 13:24:11 2025 by
|
120
120
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
121
121
|
0.9.37 (ruby-3.3.5).
|
122
122
|
</div>
|
@@ -287,7 +287,7 @@
|
|
287
287
|
</div>
|
288
288
|
|
289
289
|
<div id="footer">
|
290
|
-
Generated on Fri
|
290
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
291
291
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
292
292
|
0.9.37 (ruby-3.3.5).
|
293
293
|
</div>
|
@@ -374,7 +374,7 @@
|
|
374
374
|
</div>
|
375
375
|
|
376
376
|
<div id="footer">
|
377
|
-
Generated on Fri
|
377
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
378
378
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
379
379
|
0.9.37 (ruby-3.3.5).
|
380
380
|
</div>
|
@@ -452,7 +452,7 @@
|
|
452
452
|
</div>
|
453
453
|
|
454
454
|
<div id="footer">
|
455
|
-
Generated on Fri
|
455
|
+
Generated on Fri Feb 14 13:24:12 2025 by
|
456
456
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
457
457
|
0.9.37 (ruby-3.3.5).
|
458
458
|
</div>
|