I’m building an app where both the first portion and second portions of a route segment could be a number of different items, pulled from the database.
I obviously don’t want to hardcode a route for each one, but I’m unsure how to approach this. An example:
/georgia/atlanta
/georgia/marietta
/california/san-francisco
/california/bakersfield
/hawaii/honolulu
/hawaii/wahiawa
Would my router looks something like this?
App.Router.map(function() {
this.resource('states', { path: '/:state_id' }, function(){
this.resource('city', { path: ':city_id'});
});
});