0
私はどこにあるのかわかりません:post_idと:コメントは「作成」アクションから来ました。 from_for関数にはそれらへの参照はありません。 http://guides.rubyonrails.org/getting_started.htmlは「7.4コントローラの生成」:パラメータを理解する上でのトラブル
class CommentsController < ApplicationController
def create
@post = Post.find(params[:post_id])
@comment = @post.comments.create(params[:comment])
redirect_to post_path(@post)
end
end