Class: Devise::Generators::ControllersGenerator

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

Constant Summary collapse

CONTROLLERS =
%w(confirmations passwords registrations sessions unlocks omniauth_callbacks).freeze

Instance Method Summary collapse

Instance Method Details

#create_controllersObject



32
33
34
35
36
37
38
39
# File 'lib/generators/devise/controllers_generator.rb', line 32

def create_controllers
  @scope_prefix = scope.blank? ? '' : (scope.camelize + '::')
  controllers = options[:controllers] || CONTROLLERS
  controllers.each do |name|
    template "#{name}_controller.rb",
             "app/controllers/#{scope}/#{name}_controller.rb"
  end
end

#show_readmeObject



41
42
43
# File 'lib/generators/devise/controllers_generator.rb', line 41

def show_readme
  readme "README" if behavior == :invoke
end