You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I cannot access the :id segment via params (params is empty) in the 'user' route (not edit). I've tried this a dozen different ways. On the other hand, if I do this:
It works fine. So that's my current workaround. But everything I see suggests that the first example should work just fine. Am I missing something, or is this broken?
In the first example you gave, I would expect app/routes/user.js to be used, and in the second app/routes/users/user.js. The fact that this.resource resets the namespace/scope confuses some folks, so I am just trying to make sure that isn't what is going on here.
Where (on disk) is the route you are trying to get the params from?
Not so good, JG. I cannot understand what you're saying. Can you be more explicit, perhaps with code? I am looking at the above code snippets and it sure looks to me like there is a user route. Or do you mean that the user resource is not the same as a route? Can you give me an example of what this might look like? The Ember documentation is missing a simple example of standard CRUD in a RESTY manner.
Excellent! Thank you much. I had been playing around with the * and the .index -- those weren't the issue. The issue was moving the route out of users/ and renaming it. I'd renamed it, but left it in the users/ folder or in the user/ folder. I can sort of see why it is this way (but I'm going to be honest and say that this directory structure is ugly and will be difficult for students). My bad on the issue. I had tried so many combinations that I figured it might be an emberscript thing...
Activity
rwjblue commentedon May 20, 2014
In the first example you gave, I would expect
app/routes/user.jsto be used, and in the secondapp/routes/users/user.js. The fact thatthis.resourceresets the namespace/scope confuses some folks, so I am just trying to make sure that isn't what is going on here.Where (on disk) is the route you are trying to get the params from?
chasm commentedon May 21, 2014
You can see the failing code itself.
jgwhite commentedon May 21, 2014
Hey Charles, how’s it going?
It looks like you don’t have a
userroute to match up with theuserresource. That’s the one that’d typically turn theidparam into a model.chasm commentedon May 21, 2014
Not so good, JG. I cannot understand what you're saying. Can you be more explicit, perhaps with code? I am looking at the above code snippets and it sure looks to me like there is a user route. Or do you mean that the user
resourceis not the same as aroute? Can you give me an example of what this might look like? The Ember documentation is missing a simple example of standard CRUD in a RESTY manner.TIA!
jgwhite commentedon May 21, 2014
@chasm I’ll has a look and make a PR
chasm commentedon May 21, 2014
Yay!
chasm commentedon May 21, 2014
Excellent! Thank you much. I had been playing around with the * and the .index -- those weren't the issue. The issue was moving the route out of users/ and renaming it. I'd renamed it, but left it in the users/ folder or in the user/ folder. I can sort of see why it is this way (but I'm going to be honest and say that this directory structure is ugly and will be difficult for students). My bad on the issue. I had tried so many combinations that I figured it might be an emberscript thing...
jgwhite commentedon May 21, 2014
@chasm there is an alternative — the “pods” structure (as described here) works today. Have a play with that if you’re feeling adventurous 😄
jgwhite commentedon May 21, 2014
Can probably close this issue now, right?
chasm commentedon May 21, 2014
Yes
chasm commentedon May 21, 2014
Yup! Thanks.
Add placeholder for documenting exports from an addon