Created
November 30, 2011 17:38
-
-
Save spokrandt/1409950 to your computer and use it in GitHub Desktop.
nested forms
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
rails version 3.0.11 | |
refinery verstion 1.0.0 | |
ruby 1.9.3-p0 | |
Models: | |
user has_one | |
location belongs to | |
Form pratial: | |
<div class='field'> | |
<%= f.label :username %> | |
<%= f.text_field :username %> | |
</div> | |
<% fields_for :location do |l| %> | |
<div class='field'> | |
<%= l.label :address %> | |
<%= l.text_field :address %> | |
</div> | |
<div class='field'> | |
<%= l.label :city%> | |
<%= l.text_field :city %> | |
</div> | |
<div class='field'> | |
<%= l.label :state%> | |
<%= l.text_field :state %> | |
</div> | |
<div class='field'> | |
<%= l.label :zipcode%> | |
<%= l.text_field :zipcode %> | |
</div> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment