Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think your "render" call in your BandsNewRoute is messing things up.Try making things go more with Ember defaults. So I would refactor your app to do this:</p> <p>(working fiddle: <a href="http://jsfiddle.net/andremalan/DVbUY/" rel="nofollow">http://jsfiddle.net/andremalan/DVbUY/</a>)</p> <p>Instead of making your own render, all you need to do is create a "bands" template (it can be completely empty except for {{outlet}} if you want) and a "bands.index" template.</p> <pre><code>&lt;script type="text/x-handlebars" data-template-name="application"&gt; {{outlet}} &lt;/script&gt; &lt;script type="text/x-handlebars" data-template-name="bands/index"&gt; &lt;h2&gt;Bands Index&lt;/h2&gt; {{#linkTo bands.new}}New Band{{/linkTo}} &lt;/script&gt; &lt;script type="text/x-handlebars" data-template-name="bands"&gt; &lt;h1&gt;Bands&lt;/h1&gt; &lt;p&gt; {{#linkTo index}}Start Again{{/linkTo}} {{#linkTo bands.new}}New Band{{/linkTo}} &lt;/p&gt; {{outlet}} &lt;/script&gt; &lt;script type="text/x-handlebars" data-template-name="bands/new"&gt; I'm in new band! &lt;a {{action "cancel"}}&gt;Cancel&lt;/a&gt; &lt;/script&gt; </code></pre> <p>Your routes also clean up really nicely this way:</p> <pre><code>App.Router.map(function() { this.resource('bands', function() { this.route('new'); }); }); App.IndexRoute = Ember.Route.extend({ redirect: function() { this.transitionTo('bands'); } }); App.BandsNewController = Ember.Controller.extend({ cancel: function() { this.transitionTo('bands'); } }); </code></pre> <p>I hope that helps!</p>
    singulars
    1. This table or related slice is empty.
    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.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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