Skip to content

Commit 56921c8

Browse files
author
Matthew Saginario
committed
fixed add_route
1 parent 721ff0b commit 56921c8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ruby/rails-hyperstack/lib/generators/hyperstack/install_generator_base.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ def add_route
8282
end
8383
action_name = (@modules+[@file_name.underscore]).join('__')
8484
path = options['add-route'] == 'add-route' ? '/(*others)' : options['add-route']
85-
routing_code = "get '#{path}', to: 'hyperstack##{action_name}'"
85+
routing_code = "get '#{path}', to: 'hyperstack##{action_name}'\n"
8686
log :route, routing_code
8787
[/mount\s+Hyperstack::Engine[^\n]+\n/m, /\.routes\.draw do\s*\n/m].each do |sentinel|
8888
in_root do
89-
x = inject_into_file "config/routes.rb", optimize_indentation(routing_code, 2), after: sentinel, verbose: false, force: false
89+
inject_into_file 'config/routes.rb', routing_code.indent(2), after: sentinel, verbose: false, force: false
9090
end
9191
end
9292
end

0 commit comments

Comments
 (0)