Created
August 15, 2013 04:18
-
-
Save flarnie/6238223 to your computer and use it in GitHub Desktop.
A very basic example of a nested form.
This file contains hidden or 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 action="<%= posts_url %>" method="post"> | |
<label for="title">Title</label> | |
<input type="text" name="post[title]" value="<%= @post.title %>"> | |
<br /> | |
<label for="link_1">Link 1</label> | |
<input type="text" name="post[links_attributes][0][url]">> | |
<br /> | |
<label for="link_2">Link 2</label> | |
<input type="text" name="post[links_attributes][1][url]"> | |
<br /> | |
<label for="link_3">Link 3</label> | |
<input type="text" name="post[links_attributes][2][url]"> | |
<br /> | |
<input type="submit" value="Update Post!"> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment