Sammy.js is a controller library in javascript. But sometimes we have a 404 because our route doesn't seems to be valid to sammy.
How to know which route are defined by Sammy.js in a page ?
Something like the ruby on rails' rake routes
.
Like answers we can search on app.routes. So I have something like in coffee script :
jQuery.each app.routes, (r) ->
console.log(JSON.stringify(r))
jQuery.each app.routes[r], (u) ->
console.log(JSON.stringify(u))
or in JS
jQuery.each(app.routes, function(r) {
console.log(JSON.stringify(r));
return jQuery.each(app.routes[r], function(u) {
return console.log(JSON.stringify(u));
});
});
But it's not output the good routes I have in output :
"get"
0
1
"post"
0
1
2
etc...
So which code to do ?