我正在尝试使用acts_as_commentable GEM 向我的帖子模型添加评论。我使用 ABC 作为命名空间,所以我的所有控制器和模型都命名为 ABC::Post、ABC::User 等。
目前我的路由设置如下。
namespace :abc do
resources :post do
resources :comments
end
end
生成的路由 URL 是
POST /abc/post/:id/comments(.:format) abc/comments#create
我怎样才能做到
POST /abc/post/:id/comments(.:format) /comments#create