首页 > 解决方案 > 从数组中选择表格

问题描述

如何从数组中输入值而不是将它们输入到 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>

标签: htmlrubyforms

解决方案


我想你可以做这样的事情

您可以将 .name 更改为 .date 或 .whateveryouwant


推荐阅读