You 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.
Hey, 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...
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.
Comments
Just a nit: is that "search/:query/:page"?
You could do either, but in this case, I'm going for URLs like:
... 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.I don't think so, "example.com/#search/lemons/p7" would route to search("lemons", "7").
Actually, why use colons instead of URI templates?
http://tools.ietf.org/html/draft-gregorio-uritemplate-04
Hey, 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...
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.Cool. We use a URL patterns variant in Midgard MVC, so that should make Backbone integration easier :-)
http://github.com/bergie/midgardmvc_core