0

As says Ember's ideology: "Every application state should be shown in url". And I don't have an idea how to represent state in url for group actions on models?

As example I have edit action for song, url for this is:

http://myapplication.com/song/123/edit

But I need to have functionality for group edit. How it should represent in url? May be something like this?

http://myapplication.com/song/123,124,125,126/edit

Thanks a lot for any suggestion

vadim.zhiltsov
  • 9,294
  • 2
  • 15
  • 16
  • This feels close to the questions at http://stackoverflow.com/questions/4541338/how-to-construct-a-rest-api-that-takes-an-array-of-ids-for-the-resources and http://stackoverflow.com/questions/9371195/rest-api-requesting-multiple-resources-in-a-single-get, it'd be worth looking at the answers there – RuaidhrĂ­ Primrose Nov 19 '14 at 16:45

1 Answers1

1

You might think of the url the other way around: put the action (edit) first, then the targets. The syntax is up to you, but you could add the targets as url parameters like this:

http://myapplication.com/edit?song=123

Then if there are mutiple songs:

http://myapplication.com/edit?song=123&song=456&song=789

It's been a while since I worked in ember, so I don't remember if there's a preferred way to specify a list/array of url parameters.

Lee Jenkins
  • 2,299
  • 3
  • 24
  • 39