0
Router.map(function() {
this.resource('users', { path: '/stores/'+store_id+'/users' });
this.route('user', { path: '/stores/'+store_id+'/users/:user_id'}, function() {
this.resource('devices', { path: '/devices' });
});
});
在設備頁上我想回到/users/:user_id
。鏈接到餘燼中的上一個嵌套資源
這裏是我的template/devices.hbs
<table>
<tr>
<th>model</th>
<th>user_id</th>
</tr>
{{#each model as |device|}}
<tr>
<td>{{device.model}}</td>
<td>{{#link-to "???" ?? ???}}{{device.user_id}}{{/link-to}}</td>
</tr>
{{/each}}
</table>
我怎麼不回去的特定資源。
未被捕獲的錯誤完全合格的:沒有名爲回去/用戶/路線:USER_ID:/ – Mio
{{#鏈接到「user.index」}}作品 – Mio
以前的代碼應該也工作,但答案更新。 –