oskarrough / ember-wordpress

The bridge between Ember.js and Wordpress
http://ember-wordpress.surge.sh
MIT License
95 stars 26 forks source link

Fixes 'undefined' slug when navigating posts through categories #18

Closed dandooze closed 8 years ago

dandooze commented 8 years ago

In the category pages, post links had undefined slug.

sheriffderek commented 8 years ago

Excellent. I noticed that too.

oskarrough commented 8 years ago

Thank you for this.

I've noticed that you can either specifically pass in the slug to the link-to helper OR you can serialize the route. Like this:

serialize(model) {
  return {post_slug: model.get('slug')}
}

This way you can keep using the entire model object in the link-to helper instead of the slug. What is the best way to do it?

sheriffderek commented 8 years ago

I'm not sure. The whole 'slug' situation seems to be a Jenga tower to me right now. I'd love to know the 100% best way - but can't be sure yet.