title: Understanding options_for_select with a map in Rails
body: <pre><code>&lt;form id="earnings_select" action="&lt;%= publishers_earnings_statements_url %&gt;" method="get"&gt;
    &lt;% unless current_publisher.earnings_statements.all.size == 0 %&gt;
      &lt;%= select_tag 'id', 
                     options_for_select(current_publisher.earnings_statements.all.map{|s| [s.label, s.id.to_s]}, params[:id]),
                     :id =&gt; 'earnings_select_id' %&gt;  
      &lt;input type="submit" value="Go"&gt;
    &lt;% end %&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>That's the code that I have... can someone please explain what the <code>current_publisher.earnings_statements.all.map{|s| [s.label, s.id.to_s]}</code> bit is for?</p>
  
  <p>I'm not a Rails expert and having a hard time understanding what it means. Any help would be greatly appreciated.</p>
  
  <p>Thanks</p>