0

I know that the validates method can validate presence, length, format, uniqueness, and confirmation. However, sometimes I see people just setting these values to true/false, while other times they are more specific and pass in a hash that specifies the exact constraints (e.g. :maximum => 50 for length or case_sensitive => false for uniqueness). Is there a way that I can view a list of all the specifications that can be added to each of these validation tests?

1 Answer 1

1

This is right in the Rails API for ActiveModel::Validations::HelperMethods.

A list of validators and their respective options can be found here: http://api.rubyonrails.org/classes/ActiveModel/Validations/HelperMethods.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.