yandex_captcha 0.4.1 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -1
- data/config/routes.rb +1 -1
- data/lib/yandex_captcha/helpers/rails.rb +2 -2
- data/lib/yandex_captcha/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81fe4ac018adcdad7ad4a6af3c810b6fe0fe7b1c
|
4
|
+
data.tar.gz: 1a066cb0d9643a30f86b0f37984667f3f344b972
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e62ea594139cd88c8f10497c0d1385fd4fba11120322b04edc743a5cda150ef1d657ce3d591f0a1ba692b128d21719c69395588d3987ea202d03eae415419f6
|
7
|
+
data.tar.gz: 6105150031f7f391ed9d9c850c171175264c82870e94a7089d4ab2d5aaf25883114398735f366f696aabcc0a7134c3e7eea1f79e449f3d2b015b8dbb3df80c66
|
data/README.md
CHANGED
@@ -11,7 +11,7 @@ Unfortunatelly, this gem *is not capable with MRI 1.8.7* because of MRI 1.8.7 do
|
|
11
11
|
|
12
12
|
Add this line to your application's Gemfile:
|
13
13
|
|
14
|
-
gem 'yandex_captcha', '~> 0.4.
|
14
|
+
gem 'yandex_captcha', '~> 0.4.2'
|
15
15
|
|
16
16
|
Or:
|
17
17
|
|
@@ -25,10 +25,23 @@ Or install it yourself as:
|
|
25
25
|
|
26
26
|
$ gem install yandex_captcha
|
27
27
|
|
28
|
+
This gem can be used as Rails Engine or Sinatra Extension.
|
29
|
+
|
30
|
+
Tested:
|
31
|
+
- Rails 3.2+ (Rails 4 also checked)
|
32
|
+
- Sinatra 1.4+
|
33
|
+
|
28
34
|
## Usage
|
29
35
|
|
30
36
|
Get the api key: [http://api.yandex.ru/cleanweb/getkey.xml](http://api.yandex.ru/cleanweb/getkey.xml)
|
31
37
|
|
38
|
+
### Options
|
39
|
+
|
40
|
+
- `ajax` = `true/false`
|
41
|
+
- `noscript` = `true/false` Only for non ajax version.
|
42
|
+
|
43
|
+
### Code
|
44
|
+
|
32
45
|
```ruby
|
33
46
|
# Rails routes
|
34
47
|
mount YandexCaptcha::Engine, at: '/yandex_captcha/'
|
data/config/routes.rb
CHANGED
@@ -6,10 +6,10 @@ module YandexCaptcha
|
|
6
6
|
|
7
7
|
error = options[:error] ||= ((defined? flash) ? flash[:captcha_error] : "")
|
8
8
|
if options[:ajax]
|
9
|
-
render "yandex_captcha/captcha_ajax"
|
9
|
+
render partial: "yandex_captcha/captcha_ajax"
|
10
10
|
else
|
11
11
|
captcha = YandexCaptcha::Verify.get_captcha
|
12
|
-
render "yandex_captcha/captcha", locals: { captcha: captcha, error: error, noscript: options[:noscript] } if captcha
|
12
|
+
render partial: "yandex_captcha/captcha", locals: { captcha: captcha, error: error, noscript: options[:noscript] } if captcha
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|