但我希望它匹配 [POST] "/student_tests/1/upload"
IN 我添加的 routes.rb
resources :student_tests do
member do
post 'upload'
end
end
在 student_test_controller 我添加了
def upload
render :upload
end
在 student_test 的索引页中
<%= link_to "| Upload Scaled Scores", upload_student_test_path(test), method: :edit%>
其中 test 是 student_test 的一个对象
通过使用机架路由
upload_student_test POST /student_tests/:id/upload(.:format) student_tests#upload
我犯了什么错误,它搜索“/student_tests/upload.1”我希望它寻找“/student_tests/1/upload”(这里1是学生测试的ID)