0
我試圖使用this example但它不起作用。 我想這是因爲我使用淺層嵌套模型! 我得到這個錯誤:模板丟失Rails 3 CRUD淺層嵌套模型
Missing template pprojects/create with {:formats=>[:html], :handlers=>[:builder, :erb, :haml, :rjs, :rhtml, :rxml], :locale=>[:en, :en]}
It looks like my app is trying to do HTML and no JS because my server console says the following:
Processing by ProjectController#create as HTML
也許我這裏有一個問題:
<%= form_for([@organization, @project], :remote => true) do |f| %>
,或者因爲在我的控制我的加載方法不符合創建和更新兼容:
def load
@projects = Project.all
@project = Project.new
end
def create
@project = @organization.projects.new(params[:project])
if @project.save
flash[:notice] = "Successfully created project."
@projects = Project.all
end
end
def update
@project = Project.find(params[:id])
if @project.update_attributes(params[:project])
flash[:notice] = "Successfully updated project."
@projects = Project.all
end
你有線索嗎? 在此先感謝
你好,感謝您的回覆,但我的標籤正在工作。 – Fabien 2010-07-28 09:01:35