Complete the code to add a presence validation for the :name attribute in a Rails model.
validates :name, [1]: trueThe presence validation ensures that the attribute is not empty or nil.
Complete the code to validate presence of :email with a custom error message.
validates :email, presence: [1]Setting presence: true activates the presence validation.
Fix the error in the validation code to correctly validate presence of :title.
validates :title, [1]The correct syntax uses a symbol key and colon: presence: true.
Fill both blanks to add presence validation for :username and a custom error message.
validates :username, [1]: true, message: [2]
Use presence: true to validate presence and provide a custom message string.
Fill all three blanks to validate presence of :password with allow_nil false and a custom message.
validates :password, [1]: true, [2]: false, message: [3]
This code validates presence, disallows nil values, and sets a custom error message.