我是 ruby on rails 的新手,我无法跟上速度。我已经为用户身份验证设置了设计,一切似乎都很顺利。直到我尝试设置路线
基本上,我已经删除了我的 /public/index.html,并设置了一个新的默认路由。这是我的 /config/routes.rb
MyApp::Application.routes.draw do
authenticated :user do
root :to => 'home#index'
end
root :to => "home#index"
devise_for :users
end
好的,这看起来很简单。我生成了一个家庭控制器/视图。我的 index.html.erb 只是默认值。我的控制器也是空白的。
当我运行 rake 路由时,我可以看到到根的路由。
root / home#index
root / home#index
所以这似乎是一个尝试!但是……不是。尝试打开索引时出现错误
No route matches [GET] "/"
我不觉得我的服务器的细节应该很重要,但它是 nginx。如果有人认为这很重要,我可以发布我的服务器配置。