Skip to content

Instantly share code, notes, and snippets.

@lessless
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lessless/8c834c085b9c832be8fd to your computer and use it in GitHub Desktop.
Save lessless/8c834c085b9c832be8fd to your computer and use it in GitHub Desktop.
Testcase.AlbumTracksRoute = Ember.Route.extend
model: ->
@modelFor('album').get('tracks')
Testcase.Track = DS.Model.extend
title: DS.attr 'string'
genre: DS.attr 'string'
releaseDate: DS.attr 'string'
file: DS.attr 'string'
cover: DS.attr 'string'
album: DS.belongsTo 'album'
Testcase.Album = DS.Model.extend
title: DS.attr 'string'
releaseDate: DS.attr 'date'
cover: DS.attr 'string'
tracks: DS.hasMany 'track'
Testcase.Router.map ()->
@resource 'albums', ->
@route('new')
@route('edit')
@resource 'album', {path: ':album_id'}, ->
@resource 'tracks'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment