turnstiled 0.1.6 → 0.1.7
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/README.md +12 -6
- data/VERSION +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5be2592ba97ffc2a5b8139bf4c8c77115e63b6d84a13b3750839b70343a80d9
|
4
|
+
data.tar.gz: 0bd77e79bdaf6209dfe66420ccbcb31a647c760fdd4697b893744008561f07ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d95688510363dd08b5d5d40e7939831c3d348956bf574f0502a4dcaabfe25c07efbbd6c294c87f40627d9b925dfb93f34d06009295edeec2645be8425c08999f
|
7
|
+
data.tar.gz: e5c2d82d9c0cb713e5cb452658da51a05d3b89168f0ec8676f01d2c8675c35d0fd6a447af945d97e2578a38e6728474a2b1dde7da4d741549aa7fa5c6b85d822
|
data/README.md
CHANGED
@@ -27,10 +27,8 @@ $ bundle
|
|
27
27
|
Create a file called `config/initializers/turnstiled.rb` and add the following:
|
28
28
|
|
29
29
|
``` ruby
|
30
|
-
Turnstiled.
|
31
|
-
|
32
|
-
config.api_secret = "YOUR_API_SECRET"
|
33
|
-
end
|
30
|
+
Turnstiled.site_key = "YOUR SITE KEY"
|
31
|
+
Turnstiled.site_secret = "YOUR SITE SECRET"
|
34
32
|
```
|
35
33
|
|
36
34
|
In your layout, add the widget to the head of the document:
|
@@ -43,12 +41,20 @@ In test and development, it will include a mock widget that fires the callback a
|
|
43
41
|
|
44
42
|
The mock widget will send the `cf-turnstile-response` parameter with a value of `1`.
|
45
43
|
|
44
|
+
Within a form make sure to render the widget:
|
45
|
+
|
46
|
+
``` erb
|
47
|
+
<%= form_with model: @some_model do %>
|
48
|
+
<%= turnstile_tag %>
|
49
|
+
<% end %>
|
50
|
+
```
|
51
|
+
|
46
52
|
In your controller, you also need to verify the response with the following:
|
47
53
|
|
48
54
|
``` ruby
|
49
55
|
class PostsController < ApplicationController
|
50
|
-
|
56
|
+
verify_turnstile_request only: %i[create]
|
51
57
|
end
|
52
58
|
```
|
53
59
|
|
54
|
-
The `
|
60
|
+
The `verify_turnstile_request` takes the same options as a `before_action` method call.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.7
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: turnstiled
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Displayful
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2025-
|
12
|
+
date: 2025-03-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -64,6 +64,9 @@ licenses:
|
|
64
64
|
- MIT
|
65
65
|
metadata:
|
66
66
|
allowed_push_host: https://rubygems.org
|
67
|
+
source_code_uri: https://github.com/displayful/turnstiled
|
68
|
+
homepage_uri: https://github.com/displayful/turnstiled
|
69
|
+
bug_tracker_uri: https://github.com/displayful/turnstiled/issues
|
67
70
|
post_install_message:
|
68
71
|
rdoc_options: []
|
69
72
|
require_paths:
|