为一个类制作一个 ruby on rails 应用程序,我们不允许使用 resources 关键字,所以我的路由文件如下所示:
School::Application.routes.draw do
# Routes for departments
get "depts", :to=>"depts#index"
get "depts/new", :to=>"depts#new"
post "depts", :to=>"depts#create"
get "depts/:id", :to=>"depts#show"
get "depts/:id/edit", :to=>"depts#edit"
put "depts/:id", :to=>"depts#update"
delete "depts/:id", :to=>"depts#destroy"
end
当我尝试进入编辑页面时出现问题,这是因为我不知道路线的正确 ':as' 字段并且似乎无法在任何地方找到它们。如果我使用以下行,有人可以告诉我他们会是什么吗?
resource :depts
谢谢。