Post_pathとは以下の場合、#indexの事。
つまり下のケースだと、posts/indexにリダイレクトするように指定している。
間違ってたらごめんなさい。
まだちょっと混乱中、これどういう仕組みでindexを指定してるんだろ?
route.rb
posts GET /posts(.:format) posts#index
posts_new GET /posts/new(.:format) posts#new
GET /posts/:id(.:format) posts#show
POST /posts(.:format) posts#create
def create
@post = Post.new(
title: params[:post][:title],
author: params[:post][:author].
text: params[:post][:text]
)
if @post.save
refirect_to posts_path
else
render :new
end
end