by copying and trying to modify a scaffold manually in Rails 4, I got an error when I want to delete an article: uninitialized constant Article::Tag
.
Another error when I want to edit an Article: "undefined local variable or method `article_params'".
I don't know from where it can comes from, the highlited error which are displayed are @article.destroy
and if @article.update(article_params)
. I don't understand at all considering I think having copied perfectely the scaffold...
def destroy
@article.destroy
respond_to do |format|
format.html { redirect_to articles_url }
format.json { head :no_content }
end
end
def update
respond_to do |format|
if @article.update(article_params)
format.html { redirect_to @article, notice: 'Article was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: 'edit' }
format.json { render json: @article.errors, status: :unprocessable_entity }
end
end
end
Thansk you for your help