Routes - adamkendis/ember-discography GitHub Wiki
Routes
Route /
- Transitions to
/artists route.
Route /artists
- Sends a GET request to
/artists?include=albums
- Artists' albums can be viewed in this template so albums are sideloaded to minimize back-end calls.
- Updating an artist's attributes in this route will send a PATCH request to
/artists/:artist_id
- Deleting an artist will send a DELETE request to
/artists/:artist_id
Route /albums
- Sends a GET request to
/albums?include=artist%2Csongs
- Album's artist name and songs can be viewed in this template so artist, songs are sideloaded to minimize back-end calls.
- Note: If artists and albums are already loaded in the Ember Data store, visiting this route will only GET songs from the back-end.
- Updating an album's attributes in this route will send a PATCH request to
/albums/:album_id
- Deleting an album will send a DELETE request to
/albums/:album_id
Route /new
- Sends GET requests to
/artists, /albums, /songs resolved in the route's model via Ember RSVP.hash.
- This template renders a multi-step form for creating new resource(s) (Artist -> Album -> Song).
- Creating a new artist will send a POST request to
/artists
- Creating a new album will send a POST request to
/albums
- Creating a new song will send a POST request to
/songs