Итак у меня вылазит ошибка, при создании комментария к посту
Comments Controller
class CommentsController < ApplicationController
def create
@post = Post.find(params[:post_id])
@comment = Post.comments.create(comment_params)
redirect_to post_path(@post)
end
private def comment_params
params.require(:comment).permit(:username, :body)
end
end
Post rb
class Post < ApplicationRecord
has_many :comments
validates :title, presence: true, length: {minimum: 5}
end
Миграцию сделал, но всё-равно выводит ошибку