Note that there are some explanatory texts on larger screens.

plurals
  1. POIs resource nesting the only way to enable multiple dynamic segments?
    primarykey
    data
    text
    <p>This seems to suggest that the answer is yes:</p> <p><a href="https://stackoverflow.com/questions/14775420/from-ember-pre1-to-pre4-multiple-dynamic-segments-per-route-update-what-is-th">From Ember Pre1 to Pre4: Multiple dynamic segments per route? Update: What is the allowed syntax for dynamic segments?</a></p> <p>... but I just want to confirm.</p> <p>In my case, as a learning exercise, I'm building a calendar in Ember, with monthly displays. I need to be able to link from a given month to the previous month, and to the next month.</p> <p>So I'd like to be able to</p> <pre><code>{{ linkTo calendar_month year month }} </code></pre> <p>and</p> <pre><code>this.transitionTo('calendarMonth', year, month) </code></pre> <p>Wondering if this is feasible without using nested resources. I can get it working with something like:</p> <pre><code>App.Router.map(function() { this.resource("year", { path: "calendar/:year" }, function() { this.resource("calendar_month", { path: "/:month" }, function() { this.route('index'); }); }); }); </code></pre> <p>... but this involves introducing a Year object which might not really need to exist from a modeling perspective, just so I can use its id in linkTo</p> <p>I'd prefer to set up a route with two parameters/dynamic segments:</p> <pre><code>App.Router.map(function() { this.route('calendar_month', { path: 'calendar/:year/:month'}); }); </code></pre> <p>But am I correct that this is not possible? I just want to make sure I'm doing this the cleanest, emberiest way possible.</p> <p>Put another way:</p> <p>I understand this notion that "If your user interface is nested, then your routes should be nested", but, if my url is nested, this does not necessarily imply that my interface will be nested as well. So I'm wondering: if my url is nested, is it always best practice to build corresponding nested models?</p> <p>Any guidance / clarification much appreciated.</p> <p>thanks,</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload