我要創建「文章」的實例和瀏覽器給我一個錯誤錯誤「參數丟失或爲空值:文章」
參數是丟失或爲空值:文章
這裏我的文章控制器
class ArticlesController < ApplicationController
def index
@article = Article.all
end
def new
@article = Article.new
end
def create
@article = Article.new(article_params)
if @article.save
redirect_to @article
else
render 'new'
end
end
def show
@article = Article.find(params[:id])
end
private
def article_params
params.require(:article).permit(:title, :body)
end
end
,如何解決?
我明白error.But的這種方法,我認爲這是所有真正的,和我做了一個記錄被保存在數據庫中,並顯示在頁面,我決定創建另一個記錄和一個錯誤 – 138weare 2014-10-01 21:04:30