0
我想制作一个按钮,它允许我为除了已有的电话号码之外的另外一个电话号码创建一个新的text_field。例如,如果我想在两个单独的字段中提交两个电话号码而不是一个电话号码,那么这将如何完成?在下面的代码中,我已经开始制作一个button_to,但我不确定为了创建一个新的入门领域需要采取什么行动。谢谢。如何在表单中创建一个button_to创建一个新的entry_field。
<div>
<%= form_for @reminder do |f|%>
<%= f.label "Your Reminder"%>
<%= f.text_area :text %>
<!-- button here to make new text_field to input in an extra phone number -->
<%=button_to "add another number", %>
<%= f.label "Phone Number" %>
<%= f.text_field :phone_number %>
<%= f.label "When to be sent" %>
<%= f.text_field :time%>
<%= f.label "Picture URL" %>
<%= f.text_field :picture %>
<%= f.label "Favorite?" %>
<%= f.check_box :favorite %>
<%= f.submit %>
<% end %>
</div>
你可以做到没有javaScript? – Billy 2014-10-20 21:28:49