Class: EasyCaptcha::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/easy_captcha/install_generator.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#add_after_filterObject

:nodoc:



18
19
20
21
22
# File 'lib/generators/easy_captcha/install_generator.rb', line 18

def add_after_filter #:nodoc:
  inject_into_class 'app/controllers/application_controller.rb', ApplicationController do
    "  # reset captcha code after each request for security\n  after_filter :reset_last_captcha_code!\n\n"
  end
end

#add_devise_routesObject

:nodoc:



14
15
16
# File 'lib/generators/easy_captcha/install_generator.rb', line 14

def add_devise_routes #:nodoc:
  route 'captcha_route'
end

#copy_initializerObject

:nodoc:



10
11
12
# File 'lib/generators/easy_captcha/install_generator.rb', line 10

def copy_initializer #:nodoc:
  template 'easy_captcha.rb', 'config/initializers/easy_captcha.rb'
end