我对Ruby on Rails非常新颖。我试图通过制作简单的博客来了解指南并学习。当试图访问本地主机是给我在标题中的错误。我确信这是一个简单的解决方法,目前我无法看到它。谢谢!articles_controller.rb:26:语法错误,意外的输入结束,期待keyword_end
class ArticlesController < ApplicationController
def new
@article = Article.new
end
def create
@article = Article.new(article.params)
if @article.save
redirect_to @article
else
render 'new'
end
private
def article_params
params.require(:article).permit(:title, :text)
end
def index
@articles = Article.all
end
def show
@article = Article.find(params[:id])
end
end
如果在创建方法中缺少结尾 – Doon