2

i've been using Ember and the experience has been awesome so far. I'm now exploring Ember Data - specifically in extending RESTAdapter and modifying model.save() behavior.

Right now when I create a user using var user = this.store.createRecord('user', {name:"bob"}, then save the record using user.save(), a POST is executed to http://localhost:8080/api/users

I simply want to add a custom param to the POST URL, like so:

http://localhost:8080/api/users?inviteCode=abc123

This custom param should be set dynamically like user.save('abc123'). However, i'm at a loss at what code to modify to support this behavior.

I know i probably have to extend my User model's save method as described in this answer, but how should i proceed from there?

Community
  • 1
  • 1
garrethp
  • 51
  • 5

0 Answers0