0
我的任務是打破傳統項目中的龐大路線文件。我一直在看「split route namespaces into different files」,它似乎是最好的解決方案。將軌道分割成單獨的文件
我想包括在配置/路由路徑/ * RB通過在application.rb中文件的頂部這樣做:
config.paths.config.routes.concat Dir[Rails.root.join("config/routes/*.rb")]
,但它給出了一個錯誤:
/application.rb:23:in `<class:Application>': undefined method `config' for #<Rails::Paths::Root:0x007fa7475b48c0> (NoMethodError)
我試圖改變到
config.routes.concat Dir[Rails.root.join("config/routes/*.rb")]
的路徑,但它給錯誤「的方法失蹤」。