Reputation: 861
App.Router.map ->
@resource "sentences", ->
@resource "sentence",
path: ":sentence_id", ->
App.Sentence = DS.Model.extend(
subject: DS.attr("string")
)
http://localhost:3000/#/sentences/5
Upvotes: 1
Views: 110
Reputation: 861
how to use the two params 'reason', 'transition'
Is it possible to show one example
why does it have two params here?
Upvotes: 0
Reputation: 5075
If your server sends a 404, for such a request, Ember will raise an exception which can be handled via an errors
handler on the route. From there you can display this in the UI or transitionTo
another route that can display the error.
App.PostRoute = Ember.Route.extend({
events: {
error: function(reason, transition) {
// display error or transitionTo here
}
}
});
Upvotes: 1