samedi 27 décembre 2014

Non-resourceful routes in Ember Data

I'm writing a signup form on the home page of my web app. The form has a user model and a reminder model, both Ember Data models.


When the form submits it POSTs to /api/signups. The back-end creates the user, creates the reminder, and sends an email. There is no actual signup record created in a database.


How can I send my reminder + user data to this URL using Ember Data? I'm able to embed the reminder in the user and thereby get all the data over in one payload, but I'm not sure the most idiomatic way to tell Ember Data's adapter to POST to /api/signups (instead of e.g. /api/users or /api/reminders.





Aucun commentaire:

Enregistrer un commentaire