[英]How can I route the root of a Rails app to a specific controller?
Right now I have a path that is 'localhost:3000/boards'. 现在,我的路径是“ localhost:3000 / boards”。 So for example 'boards/new', 'boards/1', etc. How can I route that all to root.
因此,例如“ boards / new”,“ boards / 1”等。如何将它们全部路由到root。 So I could just do 'localhost:3000/new', 'localhost:3000/1' and it would route to 'boards'?
所以我可以只执行'localhost:3000 / new','localhost:3000/1'并将其路由到'boards'吗?
Thanks! 谢谢!
尝试在config / routes.rb中使用resources :board, path: "/"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.