# 两种rails里面的form使用手写下拉框的方式
<%= form_for @xxx do |f|
<%= f.select :category, [['All', 1], ['Co', 2], ['Bought', 3], ['View', 4], ['Top API', 5]], {}, class:"xxx"%>
%>
<%= select_tag(:option, options_for_select([['All', 1], ['Co', 2], ['Bought', 3], ['View', 4], ['Top API', 5]], selected: :option )) %>
参考:
https://stackoverflow.com/questions/15252900/rails-select-tag-selected-value