i have the following code:
<%= form_for Contact.new do |f| %>
<%= f.text_field :name, placeholder: 'Name', style: 'width : 15ex' %>
<%= f.text_field :phone, placeholder: 'Phone', style: 'width : 15ex' %>
<%= f.text_field :note, placeholder: 'optional notes', style: 'width : 15ex' %>
<%= submit_tag "Add", class: "btn btn-info pull-right" %>
<% end %>
this works fine for one Contact, but if i want to create two objects by clicking on the add button its not working, here is the code for two contacts.
<%= form_for Contact.new do |f| %>
<%= f.text_field :name, placeholder: 'Name', style: 'width : 15ex' %>
<%= f.text_field :phone, placeholder: 'Phone', style: 'width : 15ex' %>
<%= f.text_field :note, placeholder: 'optional notes', style: 'width : 15ex' %>
<% end %>
<%= form_for Contact.new do |f| %>
<%= f.text_field :name, placeholder: 'Name', style: 'width : 15ex' %>
<%= f.text_field :phone, placeholder: 'Phone', style: 'width : 15ex' %>
<%= f.text_field :note, placeholder: 'optional notes', style: 'width : 15ex' %>
<%= submit_tag "Add", class: "btn btn-info pull-right" %>
<% end %>
I hope you can help me.