amiel / ember-data-url-templates

an ember-addon to allow building urls with url templates instead of defining buildURL
https://github.com/amiel/ember-data-url-templates/wiki
MIT License
129 stars 22 forks source link

Forward slash is being encoded #21

Closed dzbo closed 8 years ago

dzbo commented 8 years ago

I have namespace set to api/v1 in my environment. After using template like

urlTemplate: '{+host}{/namespace}/post/{postId}/comments'

I get following path /api%2Fv1/post/1/comments which unfortunately is not recognized properly in Mirage server.

My temporary solution is by doing replace('%2F', '/') in overrided buildUrl but would be great to have that in base code.

amiel commented 8 years ago

@dzbo would something like this work for you?

namespace: 'api/v1',
urlTemplate: '{+host}/{+namespace}/post/{postId}/comments',
dzbo commented 8 years ago

@amiel yes! it works, so simple, thank you :)