Skip to content

Instantly share code, notes, and snippets.

@samgooi4189
Created July 18, 2014 06:58
Show Gist options
  • Save samgooi4189/8c2f2fe85f8d6211843a to your computer and use it in GitHub Desktop.
Save samgooi4189/8c2f2fe85f8d6211843a to your computer and use it in GitHub Desktop.
Paasing false in hidden field will get validation error
After wondering why I can't pass my model validation after assigning false boolean,
I run some test in console.
I found out that the value false is equivalent to blank. So if you set your model to validate presence, you will get error when you pass false into your input field.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment