Last active
September 15, 2015 10:27
-
-
Save Gurpartap/bbfd7b1c459c8db30d42 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"data": { | |
"id": 14830193, | |
"type": "twitter_connection", | |
"attributes": { | |
"created_at": "2015-09-15T11:19:50.201187+05:30", | |
"updated_at": "2015-09-15T11:19:50.201187+05:30", | |
"screen_name": "Gurpartap" | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import DS from 'ember-data'; | |
export default DS.JSONAPIAdapter.extend({ | |
host: 'http://localhost:3000', | |
namespace: 'api', | |
pathForType(type) { | |
return Ember.String.underscore(type); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import DS from 'ember-data'; | |
export default DS.Model.extend({ | |
createdAt: DS.attr('string'), | |
updatedAt: DS.attr('string'), | |
screenName: DS.attr('string') | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//... | |
Router.map(function() { | |
this.route('twitter_connection', { path: '/twitter/:twitter_id' }); | |
}); | |
//... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
model(params) { | |
return this.store.findRecord('twitter_connection', params.twitter_id); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import DS from 'ember-data'; | |
export default DS.JSONAPISerializer.extend({ | |
keyForAttribute(key) { | |
return Ember.String.underscore(key); | |
}, | |
keyForRelationship(key) { | |
return Ember.String.underscore(key); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment