Search code examples
ember.jsember-router

ember.js: how do nested resources correspond to templates?


given this fiddle ( I couldn't make it work, i'm sorry and very frustrated): i don't understand why, when i ask for a book detail, ember is asking not asking my books/book, but my book template. Is that a feature or i'm doing anything wrong?

And, in addition, when i structure my files tree correctly, asking for book detail gives:

-at 1st try: OUTPU: OUTER

-at 2nd try: OUTPUT: Uncaught You can't call renderToBufferIfNeeded on a destroyed view

and i really can't understand why

thank you


Solution

  • First, of all, here is a working version of your fiddle with latest ember.js and ember-data: http://jsfiddle.net/va9gc/

    The reason why ember is looking for book template instead of books/book is because you define book as a resource, not as a route. This is explained here: http://emberjs.com/guides/routing/defining-your-routes/#toc_nested-resources