Splitting Routes File Into Multiple Files

前端 未结 4 1561

I\'m working w/ a Rails 3 application and I want to split up the routes into separate files depending on the subdomain. Right now I have this in my routes.rb file:



        
4条回答
  •  一向
    一向 (楼主)
    2020-12-18 21:48

    In Rails 3.2, config.paths is now a hash, so @sunkencity's solution can be modified to:

    # config/application.rb
    config.paths["config/routes"] << File.join(Rails.root, "config/routes/fooroutes.rb")
    

提交回复
热议问题