Update route not working


#1

I have a profile route

 Remon.ProfileRoute=Ember.Route.extend({

    activate: function() {
	console.log("act");
  },

   model: function(params){
    return this.store.find("profile",params.profile_id);

 }
});

and here is my router.js

Remon.Router.map(function(){
 this.route("news");
  this.resource("profiles");
   this.resource("profile",{path:'profile/:profile_id'},function(){
 this.route("photos");
  });
 });

and my link-to helper

  {{#link-to "profile" 1}}another profile {{/link-to}}

when I visit a profile from profiles main page it work good and activate method also work but when I am on the profile page and tried to visit another profile url not changed but model data for the second profile are loaded from profiles main page when I click on a profile

Attempting transition to profile.index ember.js?body=1:3462
Transition #33: profile: calling beforeModel hook ember.js?body=1:3462
 Transition #33: profile: profile: resolving provided model ember.js?body=1:3462
  Transition #33: profile: calling afterModel hook ember.js?body=1:3462
 Transition #33: profile.index: calling beforeModel hook ember.js?body=1:3462
 Transition #33: profile.index: calling deserialize hook ember.js?body=1:3462
 Transition #33: profile.index: calling afterModel hook ember.js?body=1:3462
 Transition #33: Resolved all models on destination route; finalizing transition. ember.js?body=1:3462
  act            profile_route.js?body=1:3
  Transitioned into 'profile.index' ember.js?body=1:3462
  Transition #33: TRANSITION COMPLETE

when I click on another profile on the same profile page no transition to the new model occurred but the template changed to the new data but url keeps the previous one

 Transition #34: profile: profile: resolving provided model ember.js?body=1:3462
Transition #34: profile: calling afterModel hook ember.js?body=1:3462
Transition #34: profile.index: calling beforeModel hook ember.js?body=1:3462
Transition #34: profile.index: calling deserialize hook ember.js?body=1:3462
 Transition #34: profile.index: calling afterModel hook ember.js?body=1:3462
  Transition #34: Resolved all models on destination route; finalizing 

in console it stopped at

   Resolved all models on destination route; finalizing transition.

and "Transitioned into ‘profile’ not appeared and activate method not triggered too


#2

Hi… this isn’t the best place to discuss specific troubleshooting questions. You should use stackoverflow from my understanding.

However, when you do post to stackoverflow, you should include your full Router.map call, or at least the segment of it that includes the this.route call from within the Router.map call function, as well as your link-to handlebars snippet. It’s impossible to debug without those IMHO.


#4

I updated my question ,hope to get an answer,thanks


#5

Hiya,

If you really want an answer quickly, could I please suggest you put up a pastie bin and ask in stack overflow as well? Feel free to link to them here, and I’ll do my best to help you out. :slight_smile:


#6

The same question is also in stackoverflow with no answers


#7

Okay. I guess I’ll go find it myself then. Any chance on putting up a jsbin? If you want answers to questions, it’s in your best interests to make it really easy for people to answer you. :slight_smile:


#8

Cool. I found it. (http://stackoverflow.com/questions/22283116/reload-the-route-emberjs if anyone is reading along and interested).