ruby on rails 3 - undefined method `article_name' .................NoMethodError in ArticlesController#create -
class articlescontroller < applicationcontroller def index @articles = article.all end def show @article = article.find(params[ :id]) 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 private def article_params params.require(:article).permit(:article_name,:enter_text) end end
try with:
..... .permit(:name, :enter_text)
Comments
Post a Comment