bugzilla-ember icon indicating copy to clipboard operation
bugzilla-ember copied to clipboard

Have run into an issue while working on choosing product/component that ...

Open jessep opened this issue 11 years ago • 6 comments

...I could use help on.

Here's my route:

this.resource("browse", function(){ this.route("product", {path: ":product/:component"}); });

Here's the relevant part of the template:

{{#linkTo 'browse.product' product.name component}}{{component}}{{/linkTo}}

Here's the error I'm getting:

"Uncaught More context objects were passed than there are dynamic segments for the route: browse.product""

Also, a style question, do you want each controller/route related to browsing to be in a different file?

jessep avatar Jun 28 '13 18:06 jessep

This is a known deficiency with linkTo right now. You have to pass models, not params to it. @machty is working on it.

ebryn avatar Jun 28 '13 18:06 ebryn

You should also be passing product not product.name

ebryn avatar Jun 28 '13 18:06 ebryn

K. What's the definition of 'models'?

So, does this mean should I just use an action, then?

On Fri, Jun 28, 2013 at 11:38 AM, Erik Bryn [email protected]:

This is a known deficiency with linkTo right now. You have to pass models, not params to it. @machty https://github.com/machty is working on it.

— Reply to this email directly or view it on GitHubhttps://github.com/ebryn/bugzilla-ember/pull/13#issuecomment-20206395 .

jessep avatar Jun 28 '13 18:06 jessep

Like a model object. You could workaround this issue by using actions.

ebryn avatar Jun 28 '13 19:06 ebryn

Sorry, my question about model was too vague. Does a component, which is an attribute on the product model, count as a model? Cause we also have to pass the component.

On Fri, Jun 28, 2013 at 12:12 PM, Erik Bryn [email protected]:

Like a model object. You could workaround this issue by using actions.

— Reply to this email directly or view it on GitHubhttps://github.com/ebryn/bugzilla-ember/pull/13#issuecomment-20208310 .

jessep avatar Jun 28 '13 20:06 jessep

Models, as in objects that you would return from the model hook of the router.

ebryn avatar Jun 28 '13 21:06 ebryn