{% show_simple_captcha_tag %}

Showing simple captcha in liquid template


module Liquid
module Tags
module SimpleCaptcha
class HumanTest < ::Liquid::Tag
include ::ActionView::Helpers::FormTagHelper
include ::SimpleCaptcha::ViewHelper
attr_accessor :request, :session
def render(context)
controller = context.registers[:controller]
self.request = controller.request
self.session = controller.session
context.registers[:controller].send(:render_to_string, :partial => ::SimpleCaptcha.partial_path, :locals => { :registers => context.registers, :simple_captcha_options => simple_captcha_options({}) })
end
end
end
::Liquid::Template.register_tag('show_simple_captcha_tag', SimpleCaptcha::HumanTest)
end
end

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s