Class: Bushido::Generators::RoutesGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/bushido/routes_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_routes_fileObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/generators/bushido/routes_generator.rb', line 5

def create_routes_file
  prepend_to_file("config/routes.rb") do
<<-EOF
begin
  Rails.application.routes.draw do
    bushido_routes
  end
rescue => e
  puts "Error loading the Bushido routes:"
  puts "\#{e.inspect}"
end
EOF
  end

end