# transitionTo("some\_route") being aborted ember 2.2.0

**URL:** <https://discuss.emberjs.com/t/transitionto-some-route-being-aborted-ember-2-2-0/9447>\
**Category:** Ember Data\
**Created:** [January 19, 2016, 4:55am UTC](https://discuss.emberjs.com/t/transitionto-some-route-being-aborted-ember-2-2-0/9447 "2016-01-19T04:55:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![samtes](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/samtes/32/11885_2.png) [@samtes](https://discuss.emberjs.com/u/samtes)\
**Post date:** [January 19, 2016, 4:55am UTC](https://discuss.emberjs.com/t/transitionto-some-route-being-aborted-ember-2-2-0/9447/1 "2016-01-19T04:55:35Z")

</div>

// app/router.js

```
import Ember from 'ember';
import config from './config/environment';

const Router = Ember.Router.extend({
  location: config.locationType
});

Router.map(function() {
  this.route('questions');
  this.route('question', { path: "/questions/:question_id" });
});

```

// app/routes/questions.js

```
import Ember from 'ember';
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';

export default Ember.Route.extend(AuthenticatedRouteMixin, {
  correct: "",
  wrong: "",
  model () {
    return this.store.find("question").then(questions => {
      return this.store.find("key", this.get("session.data.authenticated.key")).then(key => {
        this.set("correct", key.get("correct"));
        this.set("wrong", key.get("wrong"));
        return key.get("questions");
      });
    });
  },

 afterModel (model, transition) {
    this.controllerFor("question").set("key", this.get("session.data.authenticated.key"));
    model = model.filter(item => {
     return this.get("correct").indexOf(item.id) === -1 && this.get("wrong").indexOf(item.id) === -1;
    });
    this.transitionTo("question", model.get("firstObject"));
  }
});

```

//app/routes/question.js

```
import Ember from 'ember';

export default Ember.Route.extend({
  model (params) {
    return this.store.find("question", params.question_id);
  },

  setupController (controller, model) {
    controller.set("model", model);
  }
});

```

//app/controllers/question.js

```
import Ember from 'ember';

export default Ember.Controller.extend({
  key: "",
  option: "",
  actions: {
    submitQuiz () {
      this.store.findRecord("key", this.get("key")).then(key => {
        key.set("answer", this.get("option"));
        key.save();
      }).then(() => {
        this.transitionToRoute("questions");
      });
    },

    selected (option, elm) {
      this.set("option", option);
      Ember.$(".question_container").find(".selected").removeClass("selected");
      Ember.$("#".concat(elm)).addClass("selected");
    }
  }
});

```

However, this.transitionToRoute(“questions”) in app/controllers/questions.js is being aborted in the middle of transition. Any idea why that’s happening??? And is there a way to force transition???

---

<div class="post-metadata">

**Author:** ![zoltan](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/zoltan/32/16699_2.png) [@zoltan](https://discuss.emberjs.com/u/zoltan)\
**Post date:** [January 19, 2016, 12:48pm UTC](https://discuss.emberjs.com/t/transitionto-some-route-being-aborted-ember-2-2-0/9447/2 "2016-01-19T12:48:47Z")

</div>

It looks to me, that you call transition after `findRecord` promise instead of `key.save()`. Have you tried `key.save().then(() => {})` ?

---

<div class="post-metadata">

**Author:** ![samtes](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/samtes/32/11885_2.png) [@samtes](https://discuss.emberjs.com/u/samtes)\
**Post date:** [January 19, 2016, 7:51pm UTC](https://discuss.emberjs.com/t/transitionto-some-route-being-aborted-ember-2-2-0/9447/3 "2016-01-19T19:51:07Z")

</div>

I had tried that too. It still doesn’t work.

---

<div class="post-metadata">

**Author:** ![samtes](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/samtes/32/11885_2.png) [@samtes](https://discuss.emberjs.com/u/samtes)\
**Post date:** [January 19, 2016, 7:53pm UTC](https://discuss.emberjs.com/t/transitionto-some-route-being-aborted-ember-2-2-0/9447/4 "2016-01-19T19:53:39Z")

</div>

I think what’s happening is transition to “questions” route gets aborted and the current page with the current model gets loaded instead. However when I manually go to path /questions, I see the proper behavior.
