Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Added support for rails 5 #33

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.rdoc
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
= EasyCaptcha
A simple captcha implementation for rails 3 based on rmagick
A simple captcha implementation for rails based on rmagick.

Tested with Rails 3.2.8
It is a fork with rails 5 support.

https://travis-ci.org/phatworx/easy_captcha.png

== Installation
add to Gemfile
gem 'easy_captcha'
gem 'easy_captcha', github: 'kopylovvlad/easy_captcha'
gem 'rmagick'

for java you can use
Expand Down
2 changes: 1 addition & 1 deletion lib/easy_captcha/captcha_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module EasyCaptcha
# captcha controller
class CaptchaController < ActionController::Base
before_filter :overwrite_cache_control
before_action :overwrite_cache_control
# captcha action send the generated image to browser
def captcha
if params[:format] == "wav" and EasyCaptcha.espeak?
Expand Down
2 changes: 1 addition & 1 deletion lib/easy_captcha/generator/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def generate(code)
require 'rmagick' unless defined?(Magick)

config = self
canvas = Magick::Image.new(EasyCaptcha.image_width, EasyCaptcha.image_height) do |variable|
canvas = Magick::Image.new(EasyCaptcha.image_width, EasyCaptcha.image_height) do
self.background_color = config.image_background_color unless config.image_background_color.nil?
self.background_color = 'none' if config.background_image.present?
end
Expand Down
4 changes: 2 additions & 2 deletions lib/easy_captcha/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module Routing #:nodoc:
class Mapper #:nodoc:
# call to add default captcha root
def captcha_route
match 'captcha' => 'easy_captcha/captcha#captcha', :via => :get
get '/captcha' => 'easy_captcha/captcha#captcha'
end
end
end
end
end