tmeasday / meteor-router

MIT License
366 stars 76 forks source link

Dynamic URI #85

Closed SergeC closed 11 years ago

SergeC commented 11 years ago

Didn't found anwser in docs so asking here. I need to build URI filter. Here a few exmaples of URI's: 1) /search/make/Mazda // find all Mazda cars in DB 2) /search/make/Mazda/model/3 // find all Mazda 3 in DB 3) /search/make/Mazda/model/3/year/2007 // find all Mazda 3 made in 2007 in DB 4) /search/year/2007 // find all cars made in 2007

Router function is: '/search/:query': function(query) { ???? }

The problem is that I cann't hardcode routes. How can pass URI after /search/ (ex: make/Mazda, make/Mazda/model/3, make/Mazda/model/3/year/2007, year/2007) into query?

tmeasday commented 11 years ago

I think this is exactly what query parameters are for (/search?make=Mazda&model=3)