changed @post.user_id = current_user to @post.user = current_user