I am using the latest version of Ember/Ember-cli/Ember-Data (1.13.x)
My data source is a JSON API service (rails-api)
I would like to have URLs like /products/:product_name instead of /products/1
I’ve searched everywhere and tried everything (changing primaryKey, normalizing name to id) but nothing works - seems like something has changed in the recent versions of Ember.
When I enter the URL manually into the browser, Ember creates a new record with ID of NAME (sorry, can’t post a screenshot as I am new here)
Thank you for the link. But unfortunately no, it doesn’t work.
I’ve moved on to working on other parts of my app for now, but I can’t imagine why this isn’t documented properly (this can be accomplished using AngularJS in a couple lines of code).
Now when you navigate to localhost:4200/foo/test, you will see this in the console: Object { bar: "test" }.
This is the equivalent of passing $routeParams to your controller in AngularJS or $stateParams if you are using ui-router. Now you should be able to find your model using variable URL params.
Edit: I missed that your question is regarding Ember Data, so this probably isn’t the answer that you’re looking for.