3 ms·
Just a nit: is that "search/:query/:page"?
by cpr 16y ago
Just a nit: is that "search/:query/:page"?
- mrduncan 16y agoI don't think so, "example.com/#search/lemons/p7" would route to search("lemons", "7").
- jashkenas 16y agoYou could do either, but in this case, I'm going for URLs like: example.com/#search/washington+news/p10 ... to make it a bit more obvious that the number at the end is a page number. This is actually a real-world example -- it's the same route that DocumentCloud uses to run searches in the workspace.
- deleted 16y ago[deleted]
- bergie 16y agoActually, why use colons instead of URI templates? http://tools.ietf.org/html/draft-gregorio-uritemplate-04 http://tools.ietf.org/html/draft-gregorio-uritemplate-04
- jashkenas 16y agoHey, that's a great idea. I've been following the progress of that draft a good bit, and we're already using URI-templates as part of the DocumentCloud API... "image":"http://s3.dcloud.org/docs/101/pages/inauguration{page}-{size}.gif" I'd be a bit concerned if we used them in Backbone, that we wouldn't be following the spec by parsing all variants of the expansions -- but on balance, it's probably a great thing to do.
- bergie 16y agoCool. We use a URL patterns variant in Midgard MVC, so that should make Backbone integration easier :-) http://github.com/bergie/midgardmvc_core http://github.com/bergie/midgardmvc_core