Class: Captchah::CaptchahController

Inherits:
ActionController::API
  • Object
show all
Defined in:
app/controllers/captchah/captchah_controller.rb

Instance Method Summary collapse

Instance Method Details

#newObject



5
6
7
8
9
10
11
12
# File 'app/controllers/captchah/captchah_controller.rb', line 5

def new
  return head(:forbidden) unless request.xhr?

  render plain: captchah_tag
rescue StandardError => e
  puts "Captchah #{e.class.name}: #{e.message}"
  head :internal_server_error
end