I am new to Ember but I like it a lot. Currently, I am experiencing with the Router
. However, I guess I don't really get it. This is the code I am using (taken from Emberjs's website):
App.Router = Ember.Router.extend({
root: Ember.State.extend({
index: Ember.State.extend({
route: '/',
redirectsTo: 'posts'
}),
posts: Ember.State.extend({
route: '/posts'
}),
post: Ember.State.extend({
route: '/posts/:post_id'
})
})
});
However, this code does nothing for me. Isn't it supposed to change the address to /posts
when I hit the index
? Am I doing something wrong? Thank you :)