Class: Uchi::ControllerGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Uchi::ControllerGenerator
- Defined in:
- lib/generators/uchi/controller/controller_generator.rb
Instance Method Summary collapse
Instance Method Details
#add_route ⇒ Object
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_file ⇒ Object
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 |