Ruby on rails Rails 3路由范围,是否排除一个操作?

Ruby on rails Rails 3路由范围,是否排除一个操作?,ruby-on-rails,Ruby On Rails,我把我的路线设置为 scope "/admin" do resources :profiles end 因此,我通过/admin/profiles获得了预期的路由。我想将show action从前缀中排除。有没有一个简单的方法可以做到这一点?我在文档中看到的每个解决方案都是围绕嵌套资源的,但我肯定我忽略了一些东西。谢谢 我想 scope "/admin", do resources :profiles, except: :show end 这就是你需要的 更多信息请访问

我把我的路线设置为

scope "/admin" do
    resources :profiles
end
因此,我通过/admin/profiles获得了预期的路由。我想将show action从前缀中排除。有没有一个简单的方法可以做到这一点?我在文档中看到的每个解决方案都是围绕嵌套资源的,但我肯定我忽略了一些东西。谢谢

我想

scope "/admin", do
  resources :profiles, except: :show
end
这就是你需要的

更多信息请访问