swistak asked:

Validators for Og

Tags:

I was wondering if there are validators for Og, similar to activerecords validation.

(1 attempts)

Kashia answered:

Yes, there are validators, the RDocs are most helpful here:

It's always:

validation_type :symbol, options_hash

Where the symbol is always the symbol you have given in the attr_accessor :symbol, Type call. The options depend on the validation type, but you can always modify options[:msg] to define a custom validation-error message.

Rating: