Skip to content

Instantly share code, notes, and snippets.

@commadelimited
Created October 1, 2013 14:55
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save commadelimited/6779774 to your computer and use it in GitHub Desktop.
Save commadelimited/6779774 to your computer and use it in GitHub Desktop.
Nested URLs
I'm trying to consume an endpoint from my server to retrieve interactions.
This interaction is restricted by account and can only be accessed once you're within the account route.
URLs
----
/activity/#/accounts/64/ <-- loads account information
/activity/#/accounts/64/interactions <-- I want to load interactions here
Ember is making a call to the interactions endpoint, but it's hitting the wrong path:
API
---
/api/1/interactions/ <-- what Ember is hitting
/api/1/accounts/64/interactions/ <-- what Ember should be hitting
Is there something I can do to alter the endpoint that Ember is trying to hit? Below are the details on my stack:
DEBUG: Ember.VERSION : 1.0.0-rc.8
DEBUG: Ember.Data.VERSION : r13
DEBUG: Handlebars.VERSION : 1.0.0
DEBUG: jQuery.VERSION : 2.0.3
Social.Router.map(function() {
this.resource('accounts', { path: '/accounts' }, function(){
this.resource('account', { path: ':account_id'}, function(){
this.resource('interactions', { path: 'interactions'});
});
});
});
@commadelimited
Copy link
Author

Ryan, that's the question I have. How do I tell the Model where to look for it's data? Is that possible in r13?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment