html - 从数组中选择表格
问题描述
如何从数组中输入值而不是将它们输入到 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>
解决方案
我想你可以做这样的事情
您可以将 .name 更改为 .date 或 .whateveryouwant
推荐阅读
- powershell - 使用 Powershell 暂停 Bitlocker - 出现错误
- apollo-server - apollo-cache-inmemory 的驱逐规则是什么?
- r - 在 Shiny 中反转客户端表以单击图形和输出
- sql - 为什么这个 SQL 语法会引发错误?
- c# - 在 ASP.NET 中丢失会话数据。重定向到登录页面
- hibernate - 用于检查 hasMany 关联是否包含某些实体的 Grails/Hibernate 标准
- swift - Swift 代码中的错误?
- android - Android中的垂直范围栏
- c - 带有 fscanf 的函数只读取 0
- machine-learning - 我们可以使用在交叉验证过程中应用的相同数据集来拟合模型吗?