Class: Guts::RoutesGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Guts::RoutesGenerator
- Defined in:
- lib/generators/guts/routes/routes_generator.rb
Overview
Routes generator
Instance Method Summary collapse
-
#add_route ⇒ Object
Inserts the route into an existing routes file.
Instance Method Details
#add_route ⇒ Object
Inserts the route into an existing routes file
12 13 14 15 16 17 18 19 20 |
# File 'lib/generators/guts/routes/routes_generator.rb', line 12 def add_route [:pathname].insert(0, '/') unless [:pathname][0] == '/' inject_into_file( 'config/routes.rb', %(\n mount Guts::Engine => "#{[:pathname]}"\n), after: '.routes.draw do' ) end |