1

Edit(current jsbin http://jsbin.com/univer/17/edit ) see comments

Output:: http://jsbin.com/univer/3/

Code:: http://jsbin.com/univer/3/edit

I'm not using the ID for the url, I'm using a slug I pass in. I don't know if that has anything to do with the issue but I can navigate directly to the nested route.

If you go here jsbin.com/univer/3#/projects/ , everything works as intended. However, if you try to go here jsbin.com/univer/3#/projects/project-1, the page is blank.

Using the rest adapter, I have the projects view rendering with the same code but the model never get's set on the project view. When you navigate directly to the page, the view renders but all you see is "This is the model:" without the name.

Any help is greatly appreciated. If needed, I can make my API public to test on the REST adapter itself but thought the fixture adapter should work the same.

Brett

BrettAHale
  • 791
  • 1
  • 5
  • 13
  • Made a little progress. You'll notice in teh App.ProjectRoute, if you hard code the model id, it works fine. So the issue seems to be with the App.Project.find not returning a model http://jsbin.com/univer/22/ – BrettAHale Aug 26 '13 at 18:28

1 Answers1

0

First issue is with the setupController method for App.ProjectRoute. It is missing the controller, model arguments.

App.ProjectRoute = Ember.Route.extend({
  setupConroller:function(controller, model){
  controller.set('model',model);
},

Next issue is that the FixtureAdapter does not support findQuery out-of-box. If you're planning to use RestAdapter instead this might not be important, but if you want to make things work in jsBin using FixtureAdapter will need to reopen DS.FixtureAdapter and add a custom queryFixtures method. Advice on how to do that can be found here: https://stackoverflow.com/a/18165887/983357

Community
  • 1
  • 1
Mike Grassotti
  • 19,040
  • 3
  • 59
  • 57
  • Here is the >> [Jsbin update](http://jsbin.com/univer/14/edit) You can see if you navigate directly to a nested route, the model doesn't seem to get set and doesn't render on the page. Thanks for the help. – BrettAHale Aug 15 '13 at 14:57
  • RESTadapter is not going to work in a JSBin since it can't actually hit your api due to cross origin access control. So current jsbin does not set models for any route. – Mike Grassotti Aug 15 '13 at 18:55
  • The api seems to work from JSBin to the api I stood up. It's pulling back the correct model for the projects controller but nothing renders for the project view. – BrettAHale Aug 15 '13 at 21:23
  • Strange - for me (in chrome) neither works - i see access control error on the api call - https://www.evernote.com/shard/s5/sh/38538b86-c6b5-4638-bc18-5f127b91086f/231323d80ed8b83c5efde37e1d63d80f/deep/0/JS%20Bin%20-%20Collaborative%20JavaScript%20Debugging.png – Mike Grassotti Aug 15 '13 at 22:27
  • Now it's not working for me. Odd, it was working for a bit and I changed the script by a bit and I guess I hosed it. I'm trying to get it back up. – BrettAHale Aug 16 '13 at 15:19
  • Ok it's working again jsbin.com/univer/17/edit Try this out and thanks again! – BrettAHale Aug 16 '13 at 16:12