Sha256: bce844283d07f739c93b93db64db7417549e74919efc13f0958d998dc9b2df58

Contents?: true

Size: 660 Bytes

Versions: 4

Compression:

Stored size: 660 Bytes

Contents

# encoding:utf-8
# class SimpleCaptchaController < ActionController::Metal 
class SimpleCaptchaController < ActionController::Base
  # include ActionController::Streaming if Rails.version.to_f < 3.1
  # include ActionController::DataStreaming if Rails.version.to_f >= 3.1
  include SimpleCaptcha::ImageHelpers

  # GET /simple_captcha
  def show
    unless params[:id].blank?
      send_file(
        generate_simple_captcha_image(params[:id]),
        :type => 'image/png',
        :disposition => 'inline',
        :filename => 'simple_captcha.png')
    else
      self.response_body = [404, {"Content-Type" => "text/html"}, ["Not Found"]]
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
wxianfeng_simple_captcha-0.5.0 app/controllers/simple_captcha_controller.rb
wxianfeng_simple_captcha-0.4.0 app/controllers/simple_captcha_controller.rb
wxianfeng_simple_captcha-0.3.0 app/controllers/simple_captcha_controller.rb
wxianfeng_simple_captcha-0.2.0 app/controllers/simple_captcha_controller.rb