嘿伙计们我遇到了rails root routs的一些问题.由于某种原因,我无法获得根URL(localhost:3000 /)来路由到适当的地方.
我已经构建了一个全新的应用程序,并使用脚手架来生成"问题"模型.我可以确认存在"索引"操作(默认情况下来自scaffold)
这是我的代码:
Fbauth::Application.routes.draw do
resources :questions
root :to => 'questions#index'
end
Run Code Online (Sandbox Code Playgroud)
耙路输出:
(in /home/jsfour/rails3_apps/fbauth)
questions GET /questions(.:format) {:action=>"index", :controller=>"questions"}
POST /questions(.:format) {:action=>"create", :controller=>"questions"}
new_question GET /questions/new(.:format) {:action=>"new", :controller=>"questions"}
edit_question GET /questions/:id/edit(.:format) {:action=>"edit", :controller=>"questions"}
question GET /questions/:id(.:format) {:action=>"show", :controller=>"questions"}
PUT /questions/:id(.:format) {:action=>"update", :controller=>"questions"}
DELETE /questions/:id(.:format) {:action=>"destroy", :controller=>"questions"}
root /(.:format) {:controller=>"questions", :action=>"index"}
Run Code Online (Sandbox Code Playgroud)
这里有什么问题?为什么localhost:3000 /给我"欢迎使用rails"的消息?