我运行rake routes
并发现了很多不在我的 routes.rb 文件中的路由:
home_index GET /home(.:format) home#index
POST /home(.:format) home#create
new_home GET /home/new(.:format) home#new
edit_home GET /home/:id/edit(.:format) home#edit
home GET /home/:id(.:format) home#show
PUT /home/:id(.:format) home#update
DELETE /home/:id(.:format) home#destroy
我手动删除了在生成脚手架时创建的文件,但不知道如何完全清理该测试的混乱。
在我的 routes.rb 文件中,我有:
# define the root
root :to => "home#about"
# define all the possible routes from the home controller
resources :home do
get "about"
get "create_subscription"
end