我想使用 FormHelper 重现以下选择结构
<select data-placeholder="Choose a Country..." name="select2" class="required select">
<option value=""></option>
<option value="opt2">India</option>
<option value="opt2">United States of America</option>
</select>
我试过什么?
<%= f.collection_select(:country_id, @countries, :id, :name, { :prompt => true },
{ :class => 'select', :selected => params[:country_id], :date => {:placeholder => 'Choose a Country...' }}) %>
但是占位符标签没有被拾起,它显示Please Select