Sha256: 1de053b45ac048dbbc17615a89cc8884799accbff50f25708f4eca01ecfe9386

Contents?: true

Size: 558 Bytes

Versions: 1

Compression:

Stored size: 558 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.3 lib/rmagick_captcha/controller_additions.rb