Note that there are some explanatory texts on larger screens.

plurals
  1. POMark the current detail entry in a master list
    text
    copied!<p>I have a list of users which are displayed in a master view on the left side (Twitter Bootstrap CSS). Details of each user can be shown by clicking the <code>show</code> button. They will be displayed on the right side (detail). </p> <p>How can I remove the <code>show</code> button for the currently displayed user? e.g. <code>#/users/1</code> shouldn't render the <code>show</code> button for the first user.</p> <p><strong>index.html</strong></p> <pre><code>&lt;script type="text/x-handlebars" data-template-name="users"&gt; &lt;div class='row'&gt; &lt;div class='span4'&gt; &lt;table class='table table-striped'&gt; {{#each model}} &lt;tr&gt; &lt;td&gt;{{lastName}}&lt;/td&gt; &lt;td&gt;{{#linkTo 'user' this}}&lt;button class="btn" type="button"&gt;show&lt;/button&gt;{{/linkTo}}&lt;/td&gt; &lt;/tr&gt; {{/each}} &lt;/table&gt; &lt;/div&gt; &lt;div class='span8'&gt; {{outlet}} &lt;/div&gt; &lt;/div&gt; &lt;/script&gt; &lt;script type="text/x-handlebars" data-template-name="user"&gt; &lt;h1&gt;{{firstName}} {{lastName}}&lt;/h1&gt; &lt;/script&gt; </code></pre> <p><strong>app.js</strong></p> <pre><code>App = Ember.Application.create(); App.Store = DS.Store.extend({ revision: 12, adapter: 'DS.FixtureAdapter' }) App.Router.map(function() { this.resource('users', function() { this.resource('user', { path: ':user_id' }) }) }); App.UsersRoute = Ember.Route.extend({ model: function() { return App.User.find(); } }); App.User = DS.Model.extend({ firstName: DS.attr('string'), lastName: DS.attr('string') }) App.User.FIXTURES = [{ id: 1, firstName: "Bill", lastName: "Clinton" }, { id: 2, firstName: "Barack", lastName: "Obama" }] </code></pre>
 

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