What is validation?
Validation is used to ensure that only accurate data is stored in the database. These database-agnostic cannot be avoided by the end-users and are very convenient to test and maintain.
What is form validation?
Form validation is a technical method in which a web form validates and checks whether the information provided by a user is accurate or not. If the data provided by the user is correct according to the input format only then the user can continue with the process, otherwise, the user is required to fix the mistake to proceed.
Why form validation is necessary?
Form validation is essential to prevent any web form abuse by a malicious user. Improper validation of form data is one of the principal reasons for security vulnerabilities.
Let's explore how to implement form validation in rails application: