js_rails_routes icon indicating copy to clipboard operation
js_rails_routes copied to clipboard

Fix nullable scope path creation

Open sdsd08013 opened this issue 6 years ago • 0 comments

  • problem

If passed Optional scope path like (/:locale)/users(.:format) to Route constructor.

Route instance member @path set value "".

because: route.path.spec.to_s.split('(') => ["", "/:locale)/users", ".:format)"]

  • change

@path = route.path.spec.to_s.sub(/\(.:format\)/, "").delete('(', '').delete(')', '')

this return right path /:locale)/users

plz check it.

sdsd08013 avatar Jan 23 '19 08:01 sdsd08013