1

I am creating a single-page application. Initially, I am using the URL "/stop/stop_id", which then loads content using stop_id.

I would like to support multiple stops. I imagine an URL like "/stop/stop_id/stop/stop_id", where it can grow by potentially endless amounts of "/stop/stop_id".

Can this reasonably be done with the Backbone router, and if so, what would you recommend?

Henrik
  • 3,908
  • 27
  • 48

1 Answers1

3

Sure. You can use route /stop/*ids and then split ids into array by / character. So you get url /stop/id1/id2/id3.

Artem Volkhin
  • 1,362
  • 8
  • 22
  • I ended up with ' routes: "stops/*ids": "loadStops"' and ' loadStop: (ids) -> stopIds = ids.split "/"' Perfect, cheers! – Henrik Jul 14 '13 at 11:59