Sha256: 63e967fb7be6278f1436ffb80b2abfa00cc9e0f1526e812b5b67ec1ccff8f454

Contents?: true

Size: 522 Bytes

Versions: 1

Compression:

Stored size: 522 Bytes

Contents

module RmagickCaptcha
  module ControllerAdditions
    module ClassMethods
      def download_rmagick_captcha(*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.4 lib/rmagick_captcha/controller_additions.rb