Skip to content

Instantly share code, notes, and snippets.

@alexspeller
Created August 9, 2013 00:06
Show Gist options
  • Save alexspeller/6189999 to your computer and use it in GitHub Desktop.
Save alexspeller/6189999 to your computer and use it in GitHub Desktop.
Ember.Model.reopenClass
adapter: MyApp.RESTAdapter.create()
camelizeKeys: true
rootKey: (->
@toString().split('.').get('lastObject').underscore()
).property()
collectionKey: (->
Em.get(@, 'rootKey') + 's'
).property()
url: (->
'/api/' + Em.get(this, 'collectionKey')
).property()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment