Sha256: 8a77e113ce39c8ecddb5ac22339677e90dfd8790e69fe9eb9e1988b0d9731637

Contents?: true

Size: 577 Bytes

Versions: 1

Compression:

Stored size: 577 Bytes

Contents

#
module RmagickCaptcha
  module ControllerAdditions
    # ::Rails.logger.error("...")

    module ClassMethods
      def download_rmagick_catcha(*symbols)
       symbols.each do |sym|
         define_method("#{sym}") do
           key = session[params[:id]]
           # Get current captcha key and send back
           image = key.nil? ? "" : ::RmagickCaptcha::RmagickBackend.get_captcha_image(key)
           send_data(image, :filename => "captcha.png", :type => "image/png", :disposition => 'inline')
         end
        end
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rmagick_captcha-0.6.2 lib/rmagick_captcha/controller_additions.rb