Nested route for CRUD


#1

Hi there!

I’m new to Ember. I have a classic Post-Comment model structure. Post has many comments. I need to send all new comments to back-end to /posts//comments instead of /comments. Is there a was to do it? Googling gives many links to questions but not to answers :frowning:


#2

Override the buildURL method for the model on the Adapter: http://emberjs.com/api/data/classes/DS.RESTAdapter.html#method_buildURL


#3

Possibly of interest https://github.com/emberjs/rfcs/pull/4 and corresponding addon https://github.com/amiel/ember-data-url-templates.


#4

thank you, ember-data-url-templates - that’s what I needed! Everything works :slight_smile: