0

According to the URL conventions, it is possible to customize the pluralization, endpoint path and host for the REST adapter. I have a model called VoiceMenu, and the adapter is performing requests to api/voice-menus/, as per the URL-conventions. But they should instead be sent to api/voicemenus/. I do not want to change the name of my model.

How can I configure the REST adapter, for this particular model?

blueFast
  • 41,341
  • 63
  • 198
  • 344

2 Answers2

0

Assuming you have api set already on your adapter, you can set the url on a per model basis like this:

App.VoiceMenu = DS.Model.extend({
  url: '/voicemenus'
  ...
});

Hope it helps.

intuitivepixel
  • 23,302
  • 3
  • 57
  • 51
  • Thanks! But ... in the model? What if I have a model property called `url`? I see a conflict there ... Is this documented? – blueFast Jul 30 '13 at 20:01
0

I got it working with:

App.Adapter.configure('plurals', {
    voice_menu : 'voicemenus',
});

I really do not like this, because this has nothing to do with plurals, but I know no other way to configure this.

blueFast
  • 41,341
  • 63
  • 198
  • 344