我每次尝试运行下面的代码时都会收到上述错误。我正试图从表单中删除信息。你可以看看“摧毁”的方法吗?无法修改冻结散列
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后删除它? –