43
44
45
46
47
48
49
50
51
|
# File 'lib/generators/active_scaffold/resource_generator.rb', line 43
def add_resource_route
routing_code = class_path.collect { |namespace| "namespace :#{namespace} do " }.join(' ')
routing_code << "resources :#{file_name.pluralize}, concerns: :active_scaffold"
routing_code << ' end' * class_path.size
log :route, routing_code
in_root do
inject_into_file 'config/routes.rb', " #{routing_code}\n", after: /^[ ]*concern :active_scaffold,.*\n/, verbose: false, force: true
end
end
|