DockYard / ember-admin

Admin backend for ember-cli projects
MIT License
241 stars 37 forks source link

Remove traling slashes from namespace if present #43

Closed Globegitter closed 9 years ago

Globegitter commented 9 years ago

When you provide an empty string for the admin namespace, but provided a namespace within your adapter then you get a resulting namespace with a trailing slash which leads to generate a url with two slashes.

Example: application adapter namespace:

namespace: 'api/v1',
host: 'http://localhost:1337'

admin namespace: namespace: '' leads to http://localhost:1337/api/v1//model

The replace makes sure that the last slash in the namespace gets removed and this then leads to the correct url http://localhost:1337/api/v1/model

bcardarella commented 9 years ago

:+1: but can we get a test to cover regressions?

Globegitter commented 9 years ago

Yep, will look into that now.

Globegitter commented 9 years ago

Added and passing. Let me know if that works.

bcardarella commented 9 years ago

Awesome, thanks. We just started using this style a month ago. Thanks for catching those.

Last request, can you squash into a single commit?

Globegitter commented 9 years ago

Yep of course - all squashed.

bcardarella commented 9 years ago

Thanks!