Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/entity-framework/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Rails中子域的资源ID_Ruby On Rails_Ruby On Rails 4_Rails Routing - Fatal编程技术网

Ruby on rails Rails中子域的资源ID

Ruby on rails Rails中子域的资源ID,ruby-on-rails,ruby-on-rails-4,rails-routing,Ruby On Rails,Ruby On Rails 4,Rails Routing,我的网址是: http://website.com/academies/1 http://website.com/academies/1/courses http://website.com/academies/1/courses/1 http://website.com/academies/1/courses/1/lessons http://website.com/academies/1/courses/1/lessons/1 但我想为每个学院使用它的子域 http://1.web

我的网址是:

http://website.com/academies/1

http://website.com/academies/1/courses

http://website.com/academies/1/courses/1

http://website.com/academies/1/courses/1/lessons

http://website.com/academies/1/courses/1/lessons/1
但我想为每个学院使用它的子域

http://1.website.com/
http://1.website.com/courses/
http://1.website.com/courses/1
http://1.website.com/courses/1/lessons
http://1.website.com/courses/1/lessons/1
我想这样做,但这不是强制性的。两个URL的架构应同时有效

Routes.rb

resources :academies do

    resources :users
    resources :courses
    resources :posts