Module: YandexCaptcha::Helpers::Rails
- Defined in:
- lib/yandex_captcha/helpers/rails.rb
Instance Method Summary collapse
Instance Method Details
#captcha_tags(options = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/yandex_captcha/helpers/rails.rb', line 4 def ( = {}) return if YandexCaptcha.skip_env if [:ajax] render partial: "yandex_captcha/captcha_ajax" else error = [:error] ||= ((defined? flash) ? flash[:yandex_captcha_error] : "") captcha = YandexCaptcha::Verify.get_captcha render partial: "yandex_captcha/captcha", locals: { captcha: captcha, error: error, noscript: [:noscript] } if captcha end end |