Open icambron opened 12 years ago
I found that it's priority problem of register, I have just a temporary solution. modify the sourcecode
//default actions
for (var i=0, key; i < orderedActions.length; i++) {
key = orderedActions[i];
if (actions[key]) this.mapDefaultAction(key, actions[key]);
}
to
//default actions
_this = this;
setTimeout(function() {
for (var i=0, key; i < orderedActions.length; i++) {
key = orderedActions[i];
if (actions[key]) _this.mapDefaultAction(key, actions[key]);
}
}, 1000);
The purose of modification is delayed loading default actions, and loading custom router at first. You can change the setTimeout time according to the actual.
This really does seem like a valid issue. Is the code above really the recommended way to fix it? The problem is that adding something like
userResource.map('get', '/logout', users.logout)
gets blocked by the :show action (expecting that the '/logout' string is an id).
What is the correct way to avoid this conflict?
Suppose I've done something like:
That doesn't work. It seems to think that "me" is the ID and passes it to
load
, thinking it's going to invokeshow
. In fact, I don't know how it would know any better. So I'm thinking there's no way to do custom collection actions; you can only do custom member actions.So first off, is that right? If so, is this something I should patch?