Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9150735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:39:02+00:00 2026-06-17T11:39:02+00:00

In the following example, using the new Router v2 API, the ember application behaves

  • 0

In the following example, using the new Router v2 API, the ember application behaves as expected with one exception.
When hovering over the dynamically created links, using a registered #linkTo Handlebars helper the id of the user is null in the url.

Clicking the link transitions to the proper state, but the url is still ‘null’.

What gives? Is there a simple convention I am missing?

App = Ember.Application.create({
  autoinit: false,
  rootElement: "body"
});

App.Store = DS.Store.extend({
  revision: 11, 
  adapter: DS.RESTAdapter.create({})
});

App.User = DS.Model.extend({
  email: DS.attr('string'),
  username: DS.attr('string')
});

App.ApplicationView = Ember.View.extend({
  templateName: 'application'
});

App.ApplicationController = Ember.Controller.extend();

App.HomeController = Ember.Controller.extend({
});

App.UserController = Ember.ObjectController.extend({
});

App.Router.map(function(match) {
  match("/").to("home");
  match("/users/:user_id").to("user");    
});

App.HomeRoute = Ember.Route.extend({
  setupController: function(controller) {
    controller.set('users', App.User.find());
  }
});

App.UserRoute = Ember.Route.extend({
  setupControllers: function(controller, user) {
    controller.set('content', user);
  }
});

App.initialize();

<script type="text/x-handlebars" data-template-name="home">

    {{#if users.isLoaded}}

      {{#each item in users}}
          <div class="user">
            {{item.email}}
          </div>

          <div class="user">
            {{#linkTo user item}}
              {{item.username}}
            {{/linkTo}}
          </div>

      {{/each}}

    {{else}}
      <p class="loading">Loading Users</p>
    {{/if}}

</script>   

<script type="text/x-handlebars" data-template-name="user">

    <div class="user">
      <h3>{{username}}</h3>
      <p class="email">{{email}}</p>
    </div>

</script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T11:39:03+00:00Added an answer on June 17, 2026 at 11:39 am

    Actually, this is probably the most complete answer to the original question:

    App.Store = DS.Store.extend({
      revision: 11, 
      adapter: DS.RESTAdapter.create({
        serializer: DS.JSONSerializer.create({
          primaryKey: function(type) {
            return '_id';
          }
        })
      })
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given the following example (using JUnit with Hamcrest matchers): Map<String, Class<? extends Serializable>> expected
I'm using the following example I found on the internet to dynamically build a
I'm following this example for creating a simple Web application using JAX-RS, MongoDB and
Take the following example... Using cn As New SqlConnection(ConnectionString) Try Dim cmd As SqlCommand
Using the following example, I need to filter out the line containing 'ABC' only,
In following example: Line1 <br /> Line2 I'm using <br /> to force Line2
I'm trying to access $a using the following example: df<-data.frame(a=c(x,x,y,y),b=c(1,2,3,4)) > df a b
I'm using Sass (.scss) for my current project. Following example: HTML <div class=container desc>
I am using the GMAP3 jquery plugin. I am using the following example to
I am trying to create dynamic menus from the database using the following example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.