Categories
Mastering Development

Rails – mark invalid nested fields

Rails is not marking nested attributes as invalid when validations fail. For example: I have two models; User and UserProfile. User contains email and password UserProfile contains username, first_name, last_name, etc User validates that email is present and unique UserProfile validates that username is present and matches a regex On the sign-up form, User accepts […]