我每次嘗試運行下面的代碼時都會收到上述錯誤。我正試圖從表單中刪除信息。你可以看看「摧毀」的方法嗎?無法修改凍結散列
class ArticlesController < ApplicationController
def show
@article = Article.find(params[:id])
end
def new
@article = Article.new
end
def create
@article = Article.new(params[:article])
@article.save
redirect_to article_path(@article)
end
def destroy
@article = Article.new(params[:article])
@article.delete
@article.save
redirect_to article_path(@article)
end
def edit
@article = Article.find(params[:id])
end
end
爲什麼在保存@article後刪除它? –