class PostsController < ApplicationController
def index
end
def new
end
def Create
@post = Post.new(post_params)
@post.save
redirect_to @post, :notice=> "created"
end
private
def post_params
params.require(:post).permit(:title, :body)
end
end
答案 0 :(得分:0)
您需要将您的方法设为小写。将Create
更改为create
。