namespace :api do
namespace :articles do
namespace :admin do
namespace :articles do
Started GET "/api/admin/articles/show?id=51403b983e2adbdf14000002&access_token=PhZ0ue89nkk5K5vGewBexw" for 127.0.0.1 at 2013-03-13 17:00:46 +0800
Processing by Api::ArticlesController#show as /
The log shows that request want to access /api/admin/articles/show and It was processed by Api::ArticlesController.
Maybe I made a mistake, someone please could point it out?
the "match shorthand" feature has some issues. We can't always guess the right controller name. You can pass controller: "" to get to specify what controller should process the request.
This could be related to a change I made #9374. I'll take a look at your situation and report back.
@googya does the Api::Admin::ArticlesController actually exist? If it doesn't then the Ruby constant lookup mechanism will find Api::ArticlesController the first time it tries, but then fail on the second attempt, e.g:
NameError: uninitialized constant Api::Admin::ArticlesController
The router code keeps hold of a reference so the first constant lookup will persist for subsequent requests.
BTW, is this Rails 4.0.0.beta1 or 3.2.12 ?
I can confirm that this issue exists. I had same problem the other day and it was on 3.2.x app.
I can try reproduce it again on my app and provide more details if needed.
@strzalek what do you confirm? The behaviour that @pixeltrix described? As far as I know this is just how the lookup is performed and it is expected behaviour not a bug.
Sorry, I wasn't clear. Let me rephrase. I've faced quite similar issue where I had controllers in same namespace and named route with the same name as those controller. I will try to reproduce that in a minute and provide you more details. In the end it will be a bit different case that described in this ticket, which I wrongly assumed was the same.
Sorry once again for confusion.
Ok, I couldn't reproduce "mine" error. There's a big chance that it was my fault.
@strzalek thanks for the update.
@googya does the description of @pixeltrix match your situation?
@senny Maybe, but I am not sure. I will give a try tomorrow!
@googya it's been two months, did you have time to verify this issue?
@googya I'm going to give this a close until you have time to reproduce, since @strzalek can't reproduce his similar-sounding issue. Thanks!