meteor / todos

The example app "Todos", written following the Meteor Guide
Other
535 stars 367 forks source link

Display list's slug in url, instead of /lists/:_id #240

Closed holgate closed 7 years ago

holgate commented 7 years ago

I'm trying to learn Meteor using Todos as an example.

But I'm stuck trying to display the List's slug in the url. I've already set up a 'slug' key in the list documents.

But I want the list's url to be more human-friendly e.g. http://localhost:3000/Shopping, instead of http://localhost:3000/lists/QeHMZa2z6EttCbnfH

How do I change the url to the slug? I've already tried modifying routes.js from

FlowRouter.route('/:_id', { to FlowRouter.route('/:slug', { but it doesn't look like the slug is coming through?

My guess is the publication is filtering out my slug string, but I can't figure out where to make the changes - any ideas?