title: Integrate select2 in simple_form
body: <p>I'm using select2 on a form.  But want to use it throughout the application.</p>
  
  <p>I have this part in my application.html.erb</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
    $(document).ready(function() {
      &lt;%= yield :document_ready %&gt;
    });
  &lt;/script&gt;
  </code></pre>
  
  <p>And this in my view:</p>
  
  <pre><code>&lt;% content_for :document_ready do %&gt;
    $("#menu_category_id").select2({minimumResultsForSearch: 10});
  &lt;% end %&gt;
  </code></pre>
  
  <p>and this is the actual input in the view:</p>
  
  <pre><code>&lt;%= f.input :menu_category_id, :collection =&gt; @product.menu.menu_categories, 
    :label_method =&gt; :name, :value_method =&gt; :id, :label =&gt; "Category" %&gt;
  </code></pre>
  
  <p>This works without any problems.  However I don't want to repeat this in all the views and would like to handle that with simple_view.</p>
  
  <p>Best would be that if I use:</p>
  
  <pre><code>&lt;%= f.input :menu_category_id, :collection =&gt; @product.menu.menu_categories, 
  :label_method =&gt; :name, :value_method =&gt; :id, :label =&gt; "Category", 
  :select2 =&gt; 'minimumResultsForSearch: 10' %&gt;
  </code></pre>
  
  <p>it would automatically put it in the :document_ready part.  So if there are 3 selects on a page it would do it for all of them with all the options that are specified in :select2</p>
  
  <p>Is this possible with custom inputs?  Or any other way?</p>