Class: Cloudfuji::Generators::RoutesGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/cloudfuji/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/cloudfuji/routes_generator.rb', line 5

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

end