Open damon opened 14 years ago
The reason this happens is that users gets called on client and added to the request path. The 2nd method, show?, is not actually called because the undefined variable error happens prior to sending show? to the Client. This leave the internal state of the request path as "/users".
You can fix this type of issue by calling client.clear which will clear the request path.
This is interesting though and makes me think that instead of using a single request path as an instance variable of the client and returning the client from the path component methods, I could create a proxy object that's returned by the path component methods that holds request state. That would prevent this confusing behavior from happening.
sounds like a good change because /users by itself in this context is useless. they only make sense taken together, I think.
at least it's understood! :)
pretty odd.
It seems that because x wasn't set the first time through, the /users part of the path gets added twice.