Skip to content

Instantly share code, notes, and snippets.

@mcansky
Created April 21, 2013 17:35
Show Gist options
  • Select an option

  • Save mcansky/5430383 to your computer and use it in GitHub Desktop.

Select an option

Save mcansky/5430383 to your computer and use it in GitHub Desktop.
I need to use another attribute (a hash, which is the id from a cloudant db) rather than id. Being new to ember, I am wondering how the route and controller need to be. Is there anything special to do for the linkTo too ? finally, is there a part of the doc treating of such cases ?
App.Router.map(function() {
this.resource('post', { path: '/posts/:post_id' });
});
App.PostRoute = Ember.Route.extend({
model: function(params) {
return App.Post.find({hash: params.post_some_attr});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment