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



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

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



39
40
41
# File 'lib/generators/devise/controllers_generator.rb', line 39

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