Rails 3更好的布线 [英] Rails 3 better routing

查看:64
本文介绍了Rails 3更好的布线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

出于好奇。
在rails3的文档中,他们说,凭经验,我不应嵌套多个资源。

Out of curiosity. In the docs of rails3 they say that as rule of thumb, I shouldn't nest more than one level of resources. Is there any better way to do that then?

  scope "(:locale)", :locale => /pl/ do

    resources :users  

    namespace "admin" do
      resources :universities do
        resources :faculties
      end
    end
  end 


推荐答案

为什么?您嵌套的资源不会超过一级:-)

Why? You're not nesting more than one level of resources :-)

这篇关于Rails 3更好的布线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆