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 9270549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:23:52+00:00 2026-06-18T15:23:52+00:00

I am working on a basic ember.js application and am a little confused with

  • 0

I am working on a basic ember.js application and am a little confused with some behavior. I have some routes that look like this:

this.resource('campaigns', { path: '/campaigns'}, function() {

    this.route('new', { path: '/new' });
    this.route('campaign', { path: '/:campaign_id' });

});

App.CampaignsIndexRoute = Ember.Route.extend({

model: function() {

    App.Keyword.find();
    return App.Campaign.find();

},

renderTemplate: function(controller, model) {

    this.render({outlet: 'page'});

}

});

App.CampaignsCampaignRoute = Ember.Route.extend({

model: function(params) {
    alert("Model Firing");
    console.log(params.campaign_id);
    return App.Campaign.find(params.campaign_id);
},
renderTemplate: function(controller, model) {
    this.render({outlet: 'page'});
    alert("Template Firing");
}

});

…and a view that looks like this:

App.CampaignsCampaignView = Em.View.extend({

templateName: 'templates/campaigns/campaign',

});

…and a main template that looks like this:

<!-- ================================================== -->
<!-- =================== APP HEADER =================== -->
<!-- ================================================== -->

{{ view App.HeaderView }}

<!-- ================================================== -->
<!-- ======================= APP ====================== -->
<!-- ================================================== -->

<div id="app" class="">

<!-- ================================================== -->
<!-- ==================== SIDEBAR ===================== -->
<!-- ================================================== -->

<div id="sidebar">

    {{ view App.NavigationView }}

    {{ view App.StarredCampaignsView }}

</div>

<!-- ================================================== -->
<!-- ====================== STAGE ===================== -->
<!-- ================================================== -->

<div id="stage" class="">

    <!-- ================================================== -->
    <!-- ================= STAGE SIDEBAR ================== -->
    <!-- ================================================== -->

        <div id="stage-sidebar" class="">

        {{ view App.StageSidebarView }}

    </div>

    <!-- ================================================== -->
    <!-- ====================== PAGE ====================== -->
    <!-- ================================================== -->

    <div id="page" class="">

        {{ outlet page }}

    </div>

</div>

</div>

As you can see there are 2 very simple alerts in the CampaignsCampaign route just to let me know what is being activated.

So, /#/campaigns returns a list of campaigns, /#/campaigns/new returns a creation page and /#/campaigns/:campaign_id should display a single campaign and its details.

This all works perfectly from inside the system. When you click a campaign from the /#/campaigns view it links directly to the detailed view, with all proper info loading.

The Issue

The problem arises if you just type in something like “http://mysite.com/#/campaigns/ANY_ID and don’t click a link from the list view. The page just loads blank and the renderTemplate is not being called (no alert). The model is loading (getting an alert) and the params.campaign_id is being passed successfully (can be logged into console successfully).

I am thinking this is a router issue but am not sure where to start. Any help would be appreciated.

Thanks for taking a look! I can post more info, just let me know what you need in comments.

  • 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-18T15:23:54+00:00Added an answer on June 18, 2026 at 3:23 pm

    The process that is followed when you go directly to a page is slightly different than if you follow a link. I don’t see the links in your template so I’m not 100% sure what is happening, but in general, if you go to the link

    {{#linkTo myRoute myVar}} A Link {{/linkTo}}
    

    The route does not run the model function, you just start with myVar as your model (but you still execute the setupController function).

    So for the hardlink to work, you need a model function that gathers the information that would have been passed in by the link variable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a basic application in C# Web. I would like to have
I have a CherryPy web application that requires authentication. I have working HTTP Basic
Working with some basic java apps on CentOS 5 linux and I have my
I have an abstract class that defines basic behavior for socially used objects throughout
this is a basic ember routing example that doesn't update the url to /posts
Trying to get some initial bearings on useful processes that a basic working knowledge
I'm working on a basic Sencha Touch application that displays a list of text
I have a service, as follows: The most basic (working) CherryPy 3.1 Windows service
Basic summary: Working on a game that generates a 15x15 grid for the player
I'm working on a basic google applications based system. Like I earlier defined I'm

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.