Socket
Book a DemoInstallSign in
Socket

rmagick_captcha

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rmagick_captcha

0.6.4
bundlerRubygems
Version published
Maintainers
1
Created
Source

RMagickCaptcha

RMagickCaptcha is a gem that implements captcha for using in Rails application. The gem provides functionality to create a captcha image and validate user's input.

  • The gem allows multiple captchas at the same page
  • The gem supports I18n and provides locale resource
  • The gem provides rmagick_captcha controller controller to generate images
  • The gem allows ...

Quick Start

In your Gemfile:

gem "rmagick_captcha", ">= 0.6.2"

In your model:

Server create captcha_key, user input into captcha_text

has_rmagick_captcha :captcha validate :validate_rmagick_captcha

In your controller:

download_rmagick_captcha :show

def new @user = User.new session[:user_captcha] = @user.reset_captcha_key end

def create @user = User.new(params[:user]) @user.captcha_key = session[:user_captcha] @user.save if @user.errors.empty? session[:user_captcha] = nil redirect_back_or_default('/welcome') flash[:notice] = "Thanks for signing up!" else session[:user_captcha] = @user.reset_captcha_key render :action => 'new' end end

In your views:

<% form_for @user, :url => users_path, :html => {:id => "user_form", :class => "html-form" } do |f| %>

  • <%= rmagick_captcha_tag(:controller => "user", :id => "user_captcha") %> <%= f.text_field :captcha_text, :maxlength => 16%> <%= f.error_message_on :captcha_text %>
<%= f.submit "Submit"%> <% end %>

In your routes.rb:

match 'user(/show)' => 'user#show', :as => :captcha

If you wish:

-Run ruby script/rails generate rmagick_captcha to gen resources such as locale files. -Use config/initiaizers to configure options for this gem

Installation

  • Type 'gem install --local rmagick_captcha' with root account if you have installed RubyGems.

Example

Example goes here.

Copyright (c) 2011 arufanov, released under the MIT license.

FAQs

Package last updated on 06 Mar 2017

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.