Class: Uchi::ControllerGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/uchi/controller/controller_generator.rb

Instance Method Summary collapse

Instance Method Details

#add_routeObject



12
13
14
# File 'lib/generators/uchi/controller/controller_generator.rb', line 12

def add_route
  route "resources :#{plural_file_name}", namespace: :uchi
end

#create_controller_fileObject



7
8
9
10
# File 'lib/generators/uchi/controller/controller_generator.rb', line 7

def create_controller_file
  destination = File.join("app/controllers/uchi")
  template "controller.rb", File.join(destination, "#{plural_file_name}_controller.rb")
end