Class: Somatics::Generators::AuthenticatedControllerGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Extended by:
TemplatePath
Defined in:
lib/generators/somatics/authenticated_controller/authenticated_controller_generator.rb

Instance Method Summary collapse

Methods included from TemplatePath

source_root

Instance Method Details

#create_localesObject



24
25
26
27
28
# File 'lib/generators/somatics/authenticated_controller/authenticated_controller_generator.rb', line 24

def create_locales
  options[:locales].each do |locale|
    template "locales_#{locale}.yml", File.join('config/locales', "#{name}_sessions_#{locale}.yml")
  end
end

#create_login_pageObject



20
21
22
# File 'lib/generators/somatics/authenticated_controller/authenticated_controller_generator.rb', line 20

def 
  template 'login.html.erb', File.join("app/views", options.namespace, "#{name}_sessions", 'new.html.erb')
end

#create_sessions_controllerObject



16
17
18
# File 'lib/generators/somatics/authenticated_controller/authenticated_controller_generator.rb', line 16

def create_sessions_controller
  template 'sessions_controller.rb', File.join('app/controllers', options.namespace, "#{name}_sessions_controller.rb")
end