Skip to content

Commit 381e84e

Browse files
authored
Merge pull request #421 from rjgoldsborough/crate-not-found-page
making ember return an error but not redirect if crate not found
2 parents 65eefe1 + 78f2227 commit 381e84e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/routes/crate.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ export default Ember.Route.extend({
44
model(params) {
55
return this.store.find('crate', params.crate_id).catch(e => {
66
if (e.errors.any(e => e.detail === 'Not Found')) {
7-
this.controllerFor('application').set('nextFlashError', `Crate '${params.crate_id}' does not exist`);
8-
return this.replaceWith('index');
7+
return this.controllerFor('application').set('flashError', `Crate '${params.crate_id}' does not exist`);
98
}
109
});
11-
},
10+
}
1211
});

app/templates/crate/error.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{ title 'Crate Not Found' }}

0 commit comments

Comments
 (0)