我正在为一个大学项目创建一个 Rails 应用程序,但我遇到了问题
# 未定义的局部变量或方法“project_materials_new”
提取的源代码(大约第 18 行):
if @project.save
redirect_to project_materials_new
#redirect_to @project
else
render 'new'
应用程序跟踪 | 框架跟踪 | 完整跟踪 app/controllers/projects_controller.rb:18:in `create'
我想重定向到不同的控制器路由...这是我的(提取)路由表...
Prefix Verb URI Pattern Controller#Action
project_materials_new GET /project_materials/new(.:format) project_materials#new
static_home GET /static/home(.:format) static#home
static_grid GET /static/grid(.:format) static#grid
static_project GET /static/project(.:format)
正如您在我定义的 project_materials_new 路线中所看到的......为什么我不能重定向到它?