Rob
Rob

Reputation: 1081

Routing With Ember Issues

I have my router for my application setup like this:

App.Router.map(function(){
    this.resource('users', function() {
        this.route('new');
     });
});

However when I try and navigate to /#users i get the error message

Assertion failed: The URL '/users.index' did not match any routes in your application

Likewise when I try and navigate to /#users/new I get

Assertion failed: The URL '/users/new.index' did not match any routes in your application

I have the following routes setup as well:

App.UsersRoute = Ember.Route.extend({});

App.UsersNewRoute = Ember.Route.extend({});

I am using Ember 1.3.2

Anyone have any suggestions on why I am receiving these errors?

Upvotes: 1

Views: 196

Answers (1)

melc
melc

Reputation: 11671

The routes will work if you enter a slash after the hash i.e. #/users and #/users/new. However if you also want it to work whether the slash exists or not then you can try the following,

emberjs dynamic route with hash only (no slashes)

you can also find an example with your routes here,

http://emberjs.jsbin.com/OzOYUxU/1#users

http://emberjs.jsbin.com/OzOYUxU/1#users/new

http://emberjs.jsbin.com/OzOYUxU/1/edit

Upvotes: 1

Related Questions