js_named_routes icon indicating copy to clipboard operation
js_named_routes copied to clipboard

Routing.root_path() is "" when it should be "/"

Open glennfu opened this issue 14 years ago • 1 comments

In my console:

>> include ActionController::UrlWriter
=> Object
>> root_path
=> "/"

In the javascript console:

>>> Routing.root_path()
""

Changing generate.js.erb to:

while (path[path.length - 1] == "/" && path != "/") {

fixes it. Does that look right?

glennfu avatar Oct 25 '11 19:10 glennfu

At a glance, yes, that looks right to me. Pull request?

gohanlon avatar Oct 26 '11 15:10 gohanlon