Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sickill-merb-recaptcha

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sickill-merb-recaptcha

  • 1.0.3
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= merb-recaptcha

== About

Merb-recaptcha is plugin for Merb web-framework. It provides view and controller helpers for Recaptcha service.

== Installation

Install gem from github.com: gem install antage-merb-recaptcha --source=http://gems.github.com

Add following line in config/dependencies.rb of your web application: dependency "antage-merb-recaptcha", "~> 1.0.0", :require_as => "merb-recaptcha"

Sign up at Recaptcha and get public and private keys. Add keys in config/init.rb: Merb::BootLoader.after_app_loads do Merb::Plugins.config[:merb_recaptcha][:public_key] = "... here your public key ..." Merb::Plugins.config[:merb_recaptcha][:private_key] = "... here your private key ..." end

== Usage

Just add helper in your form: <%= form_for @users, :action => resource(:users), :method => :post do %> ..... <%= recaptcha_tags %> <%= submit "Send" %> <% end %>

And then check captcha in controller: class Users < Application ...... def create(user) @user = User.new(user) if (captcha_correct = recaptcha_valid?) && @user.save redirect resource(@user) else unless captcha_correct @user.valid? @user.errors.add(:general, "Captcha code is incorrect") end render :new end ...... end

FAQs

Package last updated on 10 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc