Hey folks tôi đang gặp một số vấn đề với rails root routs. Đối với một số lý do tôi không thể có được url gốc (localhost: 3000 /) để định tuyến đến vị trí thích hợp.Rails 3 Root Route issues?
Tôi đã xây dựng một ứng dụng hoàn toàn mới và sử dụng giàn giáo để tạo mô hình "câu hỏi". Tôi có thể khẳng định rằng "chỉ số" hành động tồn tại (theo mặc định từ giàn giáo)
Đây là mã của tôi:
Fbauth::Application.routes.draw do
resources :questions
root :to => 'questions#index'
end
Rake đường Output:
(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"}
vấn đề là gì đây? Tại sao localhost: 3000/cho tôi thông điệp "welcome to rails"?
Bạn đã xóa tệp /public/index.html chưa? – jyoseph