So far in my model I have:
validates :title, presence: true, length: { minimum: 40 }
I am building a rails app with text fields that need to be over a specific number of characters. My model covers the issue, I am interested in a constraint too.
I would like to protect my input on both ends if possible. I am aware of the constrain that prevents input over a maximum amount of characters as in "limit (50)" for example, but I have not seen the opposite anywhere. The only time I saw something close was MinLengthConstraint
. Does anyone have an example usage of this?