<form id="earnings_select" action="<%= publishers_earnings_statements_url %>" method="get">
<% unless current_publisher.earnings_statements.all.size == 0 %>
<%= select_tag 'id',
options_for_select(current_publisher.earnings_statements.all.map{|s| [s.label, s.id.to_s]}, params[:id]),
:id => 'earnings_select_id' %>
<input type="submit" value="Go">
<% end %>
</form>
这就是我拥有的代码......有人可以解释一下这个current_publisher.earnings_statements.all.map{|s| [s.label, s.id.to_s]}
位的用途吗?
我不是 Rails 专家,很难理解它的含义。任何帮助将不胜感激。
谢谢