【问题标题】:rails3 routes how to match root `/` to path homes#indexrails3路由如何将根`/`匹配到路径homes#index
【发布时间】:2010-11-04 11:31:41
【问题描述】:

我尝试使用资源:homes 可以工作,但是第二行代码不起作用

resources :homes #right
root :to => 'homes#index'#didn't work

有什么问题?

【问题讨论】:

  • 这就是您在routes.rb 文件中的所有内容吗?

标签: ruby-on-rails ruby ruby-on-rails-3 routing routes


【解决方案1】:

您需要在routes.rb 文件的末尾添加root :to => 'homes#index'

【讨论】:

  • 实际上是我删除了公共目录中的index.html,然后一切正常
猜你喜欢
  • 2015-09-04
  • 1970-01-01
  • 1970-01-01
  • 2011-04-14
  • 2018-07-22
  • 1970-01-01
  • 2013-01-02
  • 2011-06-23
  • 1970-01-01
相关资源
最近更新 更多