Note that there are some explanatory texts on larger screens.

plurals
  1. PONested Routing Error Ember.JS and Rails
    primarykey
    data
    text
    <p>I have an ember-rails app that contains a table of servers, and a link to each individual server.</p> <p>Here is the main <code>servers.handlebars</code> file: </p> <pre><code>&lt;table id="box-table-a"&gt; &lt;thead&gt; &lt;th&gt;Name&lt;/th&gt; &lt;th&gt;Operating System&lt;/th&gt; &lt;th&gt;Build Stage&lt;/th&gt; &lt;/thead&gt; &lt;tbody&gt; {{#each server in controller}} &lt;tr&gt; &lt;td&gt; {{#link-to 'server' server}} {{server.name}} {{/link-to}} &lt;/td&gt; &lt;td&gt;{{server.operating_system}}&lt;/td&gt; &lt;td&gt;{{server.build_stage}}&lt;/td&gt; &lt;/tr&gt; {{/each}} &lt;/tbody&gt; &lt;/table&gt; {{outlet}} </code></pre> <p>Which creates the appropriate table, as expected. And when hovering over a servers name I will receive the url in in the bottom left corner of the browser: <code>#/servers/1</code>, <code>#/servers/2</code>, etc</p> <p>However, when I click the link to an individual server, the server template is not rendered. Here is my <code>server.handlebars</code> file:</p> <pre><code>&lt;div&gt; &lt;h2&gt; {{name}} &lt;/h2&gt; &lt;h2&gt; {{operating_system}} &lt;/h2&gt; &lt;h2&gt; {{build_stage}} &lt;/h2&gt; &lt;/div&gt; </code></pre> <p>Below is my <code>server.js.coffee</code> file located in the javascripts/models folder:</p> <pre><code>Warthog.Server = DS.Model.extend name: DS.attr('string') operating_system: DS.attr('string') build_stage: DS.attr('string') </code></pre> <p>My <code>serversRoute.js.coffee</code> file:</p> <pre><code>Warthog.ServersRoute = Ember.Route.extend model: -&gt; @store.find('server') </code></pre> <p>My <code>serverRoutes.js.coffee</code> file:</p> <pre><code>Warthog.ServerRoute = Ember.Route.extend model: (params) -&gt; @store.find('server', params.server_id) </code></pre> <p>Last is the <code>router.js.coffee</code> file</p> <pre><code>Warthog.Router.map -&gt; @resource "servers", -&gt; @resource "server", path: "/:server_id", -&gt; @route "edit" @route "create" </code></pre> <p>Please note that the ember toolbox within Chrome is not showing any routes and that an error is only thrown in the console when attempting to navigate to an individual server. Below is the error.</p> <pre><code>event.returnValue is deprecated. Please use the standard event.preventDefault() instead. jquery.js?body=1:5387 Ember Debugger Active VM3178:391 DEPRECATION: Action handlers contained in an `events` object are deprecated in favor of putting them in an `actions` object (error on &lt;Ember.Route:ember430&gt;) at Object.triggerEvent (http://testdomain.warthog.dev/assets/ember.js?body=1:30519:13) at trigger (http://testdomain.warthog.dev/assets/ember.js?body=1:29641:16) at handlerEnteredOrUpdated (http://testdomain.warthog.dev/assets/ember.js?body=1:29537:11) at http://testdomain.warthog.dev/assets/ember.js?body=1:29512:9 at eachHandler (http://testdomain.warthog.dev/assets/ember.js?body=1:29559:9) at setupContexts (http://testdomain.warthog.dev/assets/ember.js?body=1:29511:7) at finalizeTransition (http://testdomain.warthog.dev/assets/ember.js?body=1:29835:7) at transitionSuccess (http://testdomain.warthog.dev/assets/ember.js?body=1:29732:13) at invokeCallback (http://testdomain.warthog.dev/assets/ember.js?body=1:8055:19) ember.js?body=1:394 Error while loading route: TypeError {} ember.js?body=1:394 Uncaught TypeError: Object function () { var Class = makeCtor(), proto; Class.ClassMixin = Mixin.create(this.ClassMixin); Class.PrototypeMixin = Mixin.create(this.PrototypeMixin); Class.ClassMixin.ownerConstructor = Class; Class.PrototypeMixin.ownerConstructor = Class; reopen.apply(Class.PrototypeMixin, arguments); Class.superclass = this; Class.__super__ = this.prototype; proto = Class.prototype = o_create(this.prototype); proto.constructor = Class; generateGuid(proto, 'ember'); meta(proto).proto = proto; // this will disable observers on prototype Class.ClassMixin.apply(Class); return Class; } has no method 'create' </code></pre>
    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.
    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