【发布时间】:2019-12-08 05:52:25
【问题描述】:
如何从数组中输入值而不是将它们输入到 f.select 中。我想更改它的原因是因为选项列表现在根据其他值更改。
我有一个叫做优秀的东西,我想把每个优秀的东西放到可以选择的东西列表中。
@outstandings.each go into the f.select
或类似的东西。谢谢。
<div class = "well">
<%= form_for @userupload, html: { multipart: true } do |f| %>
<%= f.label :nealname, "Neal's Name" %>
<%= f.select :nealname, ['One Time','As Needed', 'Quarterly', 'Yearly'] %>
<%= f.submit "Save", class: "btn btn-primary" %>
<% end %>
</div>
【问题讨论】: