Search code examples
javascriptajaxember.jsember-dataember-model

ember converting ajax query string


I'm using ember-model and doing this request App.Video.find({'sort':'createdAt+asc'}); in order to get sorted video list. So it must make this request

http://localhost:1337/api/v1/videos?sort=createdAt+asc

But instead it does this

http://localhost:1337/api/v1/videos?sort=createdAt%2Basc

and replace + with %2B. Do you have any ideas how to avoid ember doing this? Thank you!


Solution

  • Ember runs encodeURIComponent on the string 'createdAt+asc'.

    Try doing App.Video.find({'sort':'createdAt asc'}); (note the space instead of the +) and seeing if that works for you.