Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where do I specify the pluralization of a model in Ember Data?

I have a model type that ends in -y: Security

How do I tell Ember Data to use /securities instead of /securitys to find resources for this?

like image 407
outside2344 Avatar asked Jun 04 '12 01:06

outside2344


1 Answers

Adding a hash to the create method doesn't seem to work with the latest version of Ember Data. I got the RESTAdapter.configure method to work as expected using the suggestion in this ticket: https://github.com/emberjs/website/pull/218 .

DS.RESTAdapter.configure("plurals", { person: "people" });
App.Store = DS.Store.extend({
  revision: 11,
  adapter: DS.RESTAdapter.create({
    namespace: 'api'
  })
});
like image 90
willimus Avatar answered Jan 19 '23 19:01

willimus