Railsコントローラーのコードで
def create
@post = Post.new(params[:post])
@post.random_hash = generate_random_hash(params[:post][:title])
if @post.save
format.html { redirect_to @post }
else
format.html { render action: "new" }
end
end
定義の最初の 2 行を入れるか入れif @post.save
ないか? 投稿が保存されていない場合、作成された Post オブジェクトPost.new
はデータベースに保存されますか?