title: Migrate Routes from Rails to Ember with Existing Rails Application using "ember-rails"
body: <p>Using gem "ember-rails" for an existing rails app. I'm attempting to route one resource using Ember, and I've been told by a number of people that this code should work, but it's not.</p>
  
  <p>I want to breakthrough the learning curve and make this work, but I need some help.</p>
  
  <p><strong>Error</strong></p>
  
  <pre><code>Routing Error
  No route matches [GET] "/newslinks"
  </code></pre>
  
  <p><strong>Code</strong></p>
  
  <p><strong>application.js</strong></p>
  
  <pre><code>//= require jquery
  //= require jquery-ui
  //= require jquery_ujs
  //= require jquery-fileupload/basic
  //= require jquery-fileupload/vendor/tmpl
  //= require chosen-jquery
  //= require bootstrap
  //= require bootstrap-notify
  //= require jquery.limit-1.2.source
  //= require bootstrap-switch
  //= require handlebars
  //= require ember
  //= require ember-data
  //= require_self
  //= require app
  </code></pre>
  
  <p><strong>app.js</strong></p>
  
  <pre><code>    App = Ember.Application.create({
    LOG_TRANSITIONS: true,
    ready: function() {
      console.log('App ready');
    }
  });
  
  App.Router.map(function() {
      this.resource('newslinks', { path: '/' });
  });
  
  App.IndexRoute = Ember.Route.extend({
    redirect: function() {
      this.transitionTo('newslinks');
    }
  });
  
  App.NewslinksRoute = Ember.Route.extend({
    model: function() {
    return App.Newslink.find();
    }
  });
  
  DS.RESTAdapter.reopen({
    namespace: 'api/v1'
  });
  
  App.Store = DS.Store.extend({
    revision: 13
  });
  
  App.Newslink = DS.Model.extend({
    name: DS.attr('string')
  });
  </code></pre>
  
  <p>routes.rb</p>
  
  <pre><code>namespace :api do
    namespace :v1 do
      resources :newslinks
    end
  end
  </code></pre>
  
  <p>application.handlebars</p>
  
  <pre><code>    &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta name="description" content="Ember - Latest" /&gt;
  &lt;meta charset=utf-8 /&gt;
  &lt;title&gt;Ember Latest&lt;/title&gt;
  &lt;link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0-rc1/css/bootstrap.min.css" rel="stylesheet"&gt;
  &lt;script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0-rc1/js/bootstrap.min.js"&gt;&lt;/script&gt;
    &lt;script src="http://code.jquery.com/jquery-1.9.1.min.js"&gt;&lt;/script&gt;
    &lt;script src="http://builds.emberjs.com/handlebars-1.0.0.js"&gt;&lt;/script&gt;
    &lt;script src="http://builds.emberjs.com/ember-latest.js"&gt;&lt;/script&gt;
    &lt;script src="http://builds.emberjs.com/ember-data-latest.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;script type="text/x-handlebars"&gt;
      &lt;h2&gt;Here I am&lt;/h2&gt;
    &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>Conclusion</strong></p>
  
  <p>Please let me know how you would recommend setting up just one route: /newslinks through Ember and getting it to render using an existing rails route.</p>
  
  <p><strong>This is not about the data (just want to render the route using ember). Also, this code works in jsbin, so it's also not about getting Ember to work independently of rails</strong></p>
  
  <p>Do I need to direct rails to render a Ember route in routes.rb? Or is Ember routing sitting on top of rails routing and cherry picking the routes it recognizes?</p>