admin管理员组文章数量:1122832
In production the nested route works but in development the route doesn't work. I get either undefined constant error from CanCan or it routes to a diferent parent route with a similar name.
I didn't develop this initially so not sure on the history of how it was built. It is also on version 3 of RoR, so finding answers for this is not so easy.
There are several other routes using this nested route and there is only one with this issue.
The controllers are setup as so
class Reports::ProjectsController < ApplicationController
load_resource
before_filter :set_active_tab
----code
end
Rake routes show the routing as expected but when trying to load the page it routes to another parent route - it is similarly named.
reports_projects GET /reports/projects(.:format) reports/projects#index
but when I try to load the page the routing log shows which is not the expected
Started GET "/reports/projects" for 127.0.0.1 at 2024-12-27 13:22:00 +0100
Processing by ProjectsController#index as HTML
If I go to Production or Staging the routing works as expected
Started GET "/reports/projects" for 127.0.0.1 at 2025-01-06 12:32:32 +0100
Processing by Reports::ProjectsController#index as HTML
How can this be resolved?
本文标签: Ruby on Rails Nestled Route going to wrong routeStack Overflow
版权声明:本文标题:Ruby on Rails Nestled Route going to wrong route - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736281490a1926332.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论