Complete the code to validate that the username is at least 3 characters long.
validates :username, length: { minimum: [1] }max instead of minimumThe minimum option sets the shortest allowed length. Here, 3 means usernames must be at least 3 characters.
Complete the code to validate that the password length is between 6 and 12 characters.
validates :password, length: { in: [1] }The in option uses a Ruby range to specify allowed length. 6..12 means password length must be between 6 and 12 characters inclusive.
Fix the error in the code to validate that the title length is at most 50 characters.
validates :title, length: { [1]: 50 }max instead of maximumlimit which is not valid hereThe correct key to set the maximum length is maximum. Using max or limit will cause errors.
Fill both blanks to validate that the email length is exactly 10 characters.
validates :email, length: { [1]: [2] }minimum or maximum instead of isThe is key sets an exact length. Setting it to 10 means the email must be exactly 10 characters long.
Fill all three blanks to validate that the nickname length is between 4 and 8 characters and allow blank values.
validates :nickname, length: { [1]: [2], [3]: true }allow_nil instead of allow_blankminimum and maximum keys separatelyThe in key sets the length range. allow_blank: true lets the field be empty without error.