Skip to content

Instantly share code, notes, and snippets.

@oliviachang29
Last active September 23, 2018 19:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oliviachang29/f9a41d31f115928d3115b3444a657c7b to your computer and use it in GitHub Desktop.
Save oliviachang29/f9a41d31f115928d3115b3444a657c7b to your computer and use it in GitHub Desktop.
app/views/parents/new.html.erb
<%= form_for(@parent) do |f| %>
… parent attributes go here …
<ul>
<%= f.nested_fields_for :kids do |kids_form| %>
<li>
<%= kids_form.text_field :name %>
</li>
<% end %>
</ul>
<%= f.submit "Create Parent" %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment