我在 Rails 3.2.9 中收到以下错误:
Template is missing
Missing template projects/create, application/create with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee]}. Searched in: * "c:/Documents and Settings/.../app/views"
我昨天开始收到这个错误,回去重建我的控制器,但仍然收到错误。rails generate scaffold
然后,我在命令行上使用重建了所有内容。当我进入保存一个新的对象实例时,我仍然遇到同样的错误。
我的假设是脚手架生成器会在准系统的基础上生成正确的代码,然后让我一块一块地重建功能。
我在下面包含模型和控制器的代码:
class Project < ActiveRecord::Base
attr_accessible :title, ...
end
++++++++++
class ProjectsController < ApplicationController
# GET /projects
def index
@projects = Project.all
end
# GET /projects/1
def show
@project = Project.find(params[:id])
end
# GET /projects/new
def new
@project = Project.new
end
# GET /projects/1/edit
def edit
@project = Project.find(params[:id])
end
# POST /projects
def create
@project = Project.new(params[:project])
@project.save
end
# PUT /projects/1
def update
@project = Project.find(params[:id])
end
# DELETE /projects/1
def destroy
@project = Project.find(params[:id])
@project.destroy
end
end
有人有想法么?Rails 是否在一夜之间开发了一个错误?我无法使用 Google-Fu 找到任何可能归因于此的东西。谢谢。