Class: TheRoleGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/the_role/the_role_generator.rb

Instance Method Summary collapse

Instance Method Details

#generate_controllersObject

bundle exec rails g the_role NAME



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/generators/the_role/the_role_generator.rb', line 6

def generate_controllers
  if gen_name == 'install'
    cp_models
    cp_config
  elsif gen_name == 'config'
    cp_config
  elsif gen_name == 'models'
    cp_models
  elsif gen_name == 'controllers'
    cp_controllers
  elsif gen_name == 'locales'
    cp_locales
  elsif gen_name == 'help'
    cp_help
  else
    puts 'TheRole Generator - wrong Name'
    puts 'Try to use install'
  end
end