过去两个小时我一直在与同样的问题作斗争,错误很愚蠢但不容易看到。
秘密在文件中conf/routes
:如果你有这样的东西:
# Routes
# This file defines all application routes (Higher priority routes first)
# ~~~~
# Home page
GET / controllers.Application.index()
# Map static resources from the /public folder to the /assets URL path
GET /assets/*file controllers.Assets.at(path="/public", file)
GET /login controllers.Application.login()
POST /login controllers.Application.authenticate()
GET /logout controllers.Application.logout()
POST /projects controllers.Projects.add()
POST /projects/groups controllers.Projects.addGroup()
DELETE /projects/:project controllers.Projects.delete(project: Long)
PUT /projects/:project controllers.Projects.rename(project: Long)
GET /projects/:project/tasks controllers.Tasks.index(project: Long)
POST /projects/:project/tasks controllers.Tasks.add(project: Long, folder: String)
GET /assets/javascripts/routes controllers.Application.javascriptRoutes()
当尝试下载javascriptRoutes时,由于规则的原因,它没有正确下载,GET /assets/*file controllers.Assets.at(path="/public", file)
它具有更高的优先级。相反,这条规则必须在 . 的末尾conf/routes
,所以文件应该是这样的:
# Routes
# This file defines all application routes (Higher priority routes first)
# ~~~~
# Home page
GET / controllers.Application.index()
GET /login controllers.Application.login()
POST /login controllers.Application.authenticate()
GET /logout controllers.Application.logout()
POST /projects controllers.Projects.add()
POST /projects/groups controllers.Projects.addGroup()
DELETE /projects/:project controllers.Projects.delete(project: Long)
PUT /projects/:project controllers.Projects.rename(project: Long)
GET /projects/:project/tasks controllers.Tasks.index(project: Long)
POST /projects/:project/tasks controllers.Tasks.add(project: Long, folder: String)
GET /assets/javascripts/routes controllers.Application.javascriptRoutes()
# Map static resources from the /public folder to the /assets URL path
GET /assets/*file controllers.Assets.at(path="/public", file)
使用该解决方案,我认为您的错误将消失=)。