sinatra relative routes don't start with slash
This commit is contained in:
parent
fa93a81d91
commit
8d5db5d3d6
2
app.rb
2
app.rb
|
@ -5,7 +5,7 @@ require 'yaml'
|
||||||
|
|
||||||
def get_url(domain_object, rel_route)
|
def get_url(domain_object, rel_route)
|
||||||
if domain_object.is_a? Hash
|
if domain_object.is_a? Hash
|
||||||
return domain_object['root'] + rel_route
|
return domain_object['root'] + "/" + rel_route
|
||||||
elsif domain_object.is_a? String
|
elsif domain_object.is_a? String
|
||||||
return domain_object
|
return domain_object
|
||||||
end
|
end
|
||||||
|
|
2
test.rb
2
test.rb
|
@ -39,7 +39,7 @@ class TestConfig < Minitest::Test
|
||||||
|
|
||||||
def get_url(domain_object, rel_route)
|
def get_url(domain_object, rel_route)
|
||||||
if domain_object.is_a? Hash
|
if domain_object.is_a? Hash
|
||||||
return domain_object['root'] + rel_route
|
return domain_object['root'] + "/" + rel_route
|
||||||
elsif domain_object.is_a? String
|
elsif domain_object.is_a? String
|
||||||
return domain_object
|
return domain_object
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue