Last active
September 23, 2018 19:16
-
-
Save oliviachang29/b3661f9f55f0d35c35bf26a44e0b445f to your computer and use it in GitHub Desktop.
app/views/parents/new.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_for(@parent) do |f| %> | |
… parent attributes go here … | |
<ul> | |
<%= f.nested_fields_for :kids do |kids_form| %> | |
<li> | |
<%= kids_form.text_field :name %> | |
<%= kids_form.remove_nested_fields_link %> # Delete link | |
</li> | |
<% end %> | |
</ul> | |
<%= f.add_nested_fields_link :kids do %> | |
<span>New Kid</span> | |
<% end %> | |
<%= f.submit "Create Parent" %> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment