我有一个看起来像这样select_tag
的:options_for_select
<%= select_tag "respondent", options_for_select(1..5, 2) %>
输出:
<select id="respondent" name="respondent">
<option value="1">1</option>
<option value="2" selected="selected">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
但我希望它输出的是这样的:
<select id="respondent" name="respondent">
<option value="/arbitrary/page/1">#1</option>
<option value="/arbitrary/page/2" selected="selected">#2</option>
<option value="/arbitrary/page/3">#3</option>
<option value="/arbitrary/page/4">#4</option>
<option value="/arbitrary/page/5">#5</option>
</select>
我怎样才能做到这一点?