Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在单选按钮中添加范围 1..5。任何帮助深表感谢。
<%= f.radio_button :rating ,:class => "form-control" %>
这应该可以完成这项工作。
<%= f.collection_radio_buttons :rating, (1..5).map{|n| [n, n]}, :first, :last, :class => "form-control"" %>