title: Rails 5: Fastest way to fetch huge records in select
body: <p>I have a Rails application which loads more than 2k registers from a model on a select with <a href="https://github.com/nathanvda/cocoon" rel="nofollow noreferrer">cocoon</a> for association. I'm already use select2 jQuery plugin to scroll it and search the topics, but it loads very slowly.</p>
  
  <pre><code>&lt;%= f.select :subject_id, options_for_select(Subject.all.map{ |c| [c.name, c.id, {}] }, f.object.subject_id), {include_blank: 'Select a subject'}, {required: true, class: "select2 "} %&gt;
  </code></pre>
  
  <p>This model load more than 2k registers from model and makes select load slowly, what's is the best practice to load the register more quickly from model for user?</p>