Ruby on Rails应用程序根 [英] Ruby on rails application root
本文介绍了Ruby on Rails应用程序根的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何更改Rails应用程序,以使控制器foo显示为应用程序根目录?
How do I change a rails app so that a controller foo appears as the application root?
换句话说,现在所有的URL看起来都像host.com/foo / ...,我想摆脱foo并简单地托管.com / ...
In other words, right now all the urls look like host.com/foo/... and I'd like to get rid of the foo and have simply host.com/...
推荐答案
在routes.rb中,添加:
In routes.rb, add:
map.root :controller => 'foo'
API 。
这篇关于Ruby on Rails应用程序根的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文