2

I can account for pluralisation using:

DS.RESTAdapter.configure("plurals", {
  query: "queries"
});

but I need to append '.json' to all of the routes that are being generated as the API I am working with throws an error if this does not happen. Struggling to find documentation on ember-data, what's the best way to do this?

i0n
  • 916
  • 1
  • 8
  • 26

1 Answers1

10

You can override the buildURL method of your Adapter, example :

App.Adapter = DS.RESTAdapter.extend({
    buildURL: function(record, suffix) {
      return this._super(record,suffix) + '.json'
    }
});

See this fiddle for a live example.

Adrien Coquio
  • 4,870
  • 2
  • 24
  • 37