Sha256: 34748821e181419ecba7f654a158b66d806f37931296dbf47d3a1973cb716fc7

Contents?: true

Size: 503 Bytes

Versions: 2

Compression:

Stored size: 503 Bytes

Contents

module YandexCaptcha
  module Helpers
    module Rails
      def captcha_tags(options = {})

        error = options[:error] ||= ((defined? flash) ? flash[:captcha_error] : "")
        if options[:ajax]
          render partial: "yandex_captcha/captcha_ajax"
        else
          captcha = YandexCaptcha::Verify.get_captcha
          render partial: "yandex_captcha/captcha", locals: { captcha: captcha, error: error, noscript: options[:noscript] } if captcha
        end
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
yandex_captcha-0.4.3.4 lib/yandex_captcha/helpers/rails.rb
yandex_captcha-0.4.3.3 lib/yandex_captcha/helpers/rails.rb