Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4837

peekRecord - can I use a slug rather than id?

$
0
0

@therealbenhogan wrote:

Hi,

I would prefer to use a unique slug to retrieve my models rather than an ID... This is ok for findRecord eg

model(params) {
   return this.store.findRecord('product',params.slug) 
}

Can you do the same for peekRecord rather than having to pass an integer for the ID?

Update - I am returning the slug as the ID in the JSON API response ... not sure if this is the best way to do it but it's working !

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4837

Trending Articles