title: Rails Simple Form Checkbox variable undefined
body: <p>I am creating a rails simple form which has two fields: a collection and a checkbox. The values inside the collection are determined based on whether the checkbox is selected or not.</p>
  
  <pre><code>&lt;%= f.input :id, :collection =&gt; (@s if show_all_shoppers || @rs), :label_method =&gt; :name, :value_method =&gt; :id, :label =&gt; "Shopper", :include_blank =&gt; true %&gt;
  
  &lt;%= f.input :show_all_shoppers, :as =&gt; :boolean, :label =&gt; false, :input_html =&gt; { :'data-label' =&gt; 'Display all shoppers'} %&gt;
  </code></pre>
  
  <p>But, I keep getting <code>undefined local variable or method show_all_shoppers</code> when I try this. Please note <code>:id</code> is a fieldname inside my model instance but <code>show_all_shoppers</code> is not</p>
  
  <p>How can I correct this?</p>