RailsGuides - Getting Started with Rails. Add Comment validation

Hi everyone. I’m new to Rails so trying to read all the documentation.

While reading through the Getting Started with Rails I’ve noticed that there is no section about article Comments validation, but I think it would be great to have such chapter. It is hard for me to make it up for now, so I would appreciate any guidance on how to create Comment validation(mandatory author and body) and show errors of invalid submission to the user.
I’m looking for a way to do something like you suggest in Article validation, I’ve tried to modify it in some ways, but it didn’t work.
Thank you for any help.

Hi there, fwiw I asked the AI - maybe it works or makes it clearer how to. Have a lovely day.