我想显示“年份:“的参数字段。如何将文本追加到参数字段中?
我使用的select_tag如下所示:
<%= form_tag results_path, :method => 'get' do %>
<%= select_tag :season_year, options_for_select(@tournaments.order(season_year: :desc).collect{ |u| [u.season_year] }.uniq, session[:season_year]), class: "btn btn-outline-primary", :onchange => "this.form.submit();" %>
<%= select_tag :tournament, options_for_select(@tournaments_filtered.order(tournament_date: :desc).collect{ |u| [u.lake_name, u.id] }, session[:tournament]), class: "btn btn-outline-primary", :onchange => "this.form.submit();" %>
<%= select_tag :table_select, options_for_select(@result_options, session[:table_select]), class: "btn btn-outline-primary", :onchange => "this.form.submit();" %>
<% end %>
1条答案
按热度按时间oxcyiej71#
可以使用
include_blank
选项添加 dud 选项。即添加
include_blank: "Year:"
有关详细信息,请参阅docs