How render other template if model rejected?


#1

Hello.

My Ember version is 1.12.

If my app gets a 404, I do transitionTo(‘errors.not-found’) as it is written in Loading / Error Substates

error: function(result) {
	if (result && result.status === 404) {
		return this.transitionTo('errors.not-found');
	}
},

But there’s a problem. Url user change to ‘errors/not-found’ and when he clicks “back”, it goes back to the page with the 404 and it was again transferred to ‘errors/not-found’.

If I write:

error: function(result) {
	this.render('errors.not-found');
},

I get a blank white screen.

How I can just render the other templet if you received an error in the model?


#2

Have you tried using replaceWith instead of transitionTo? Not sure if it was always private or not…


#3

replaceWith is a private, not very good to use it?


#4

It wasn’t always private, it could be a mistake. There have been a lot of methods incorrectly marked as private as of late.