Open hirolibe opened 3 weeks ago
特定の記事にコメントしたユーザー情報の付与 @comment.user = current_user
def create album = Album.find(params[:album_id]) @comment = album.comments.build(comment_params) @comment.user = current_user if @comment.save redirect_to album_comments_path(album_id: album.id) else flash.now[:error] = 'コメントできませんでした' render :new end end
特定の記事にコメントしたユーザー情報の付与 @comment.user = current_user