title: Validate multiple checkbox in rails
body: <p>I want to validate multiple checkbox to "select atleast one"<br>
  view:</p>
  
  <pre><code>&lt;label&gt;
  &lt;input type="checkbox" name="type_one" class="r_type" id="one" value="PA"&gt;one&lt;/label&gt;
  &lt;label&gt; 
  &lt;input type="checkbox" name="type_two" class="r_type" id="two" value="FA"&gt;two&lt;/label&gt;
  &lt;label&gt;
  &lt;input type="checkbox" name="type_three" class="r_type" id="three" value="MA"&gt;three&lt;/label&gt;
  &lt;label&gt;
  &lt;input type="checkbox" name="type_four" class="r_type" id="four" value="AD"&gt;four&lt;/label&gt;
  </code></pre>
  
  <p>Model:</p>
  
  <pre><code>validate :atleast_one_is_checked
  
    def atleast_one_is_checked
      errors.add(:base, "Select atleast one output format type") unless type_one || type_two || type_three || type_four
    end
  </code></pre>
  
  <p>I got <code>undefined method or variable "type_one" error</code>.</p>