title: Rails 4 - Validate Elements in Array
body: <p>One of my models contains a virtual attribute called <code>things</code>. This attribute is an array, and I'd like every element within that array to be validated against a set of rules. Here is my current attempt at validation:</p>
  
  <pre><code>validates :things, presence: true,  length: { minimum: 2, maximum: 255 }
  </code></pre>
  
  <p>The problem with this code is that it validates the entire array itself, not each individual element within the array. I know I can write a custom validator, but is there any way to use the existing validation options to run these validations against every element in the array? The other topics I found on this are for older versions of Rails, so I'm not sure if Rails 4 has something new that could help with this.</p>
  
  <p>Thanks in advance for any help!</p>