Skip to content

Instantly share code, notes, and snippets.

@lesce
Created March 27, 2012 11:59
Show Gist options
  • Select an option

  • Save lesce/2215307 to your computer and use it in GitHub Desktop.

Select an option

Save lesce/2215307 to your computer and use it in GitHub Desktop.
<%= debug @user.user_addresses %>
<%= f.fields_for @user.user_addresses do |ua| %>
<%= debug ua.object.is_home_address %>
<%= debug ua.object.is_work_address %>
and in the browser I get this
---
- !ruby/object:UserAddress
attributes:
id:
user_id:
country:
state:
zip:
street:
city:
is_delivery_address:
is_home_address: true
is_work_address:
is_billing_address:
other_address_info:
street2:
fax:
phone:
- !ruby/object:UserAddress
attributes:
id:
user_id:
country:
state:
zip:
street:
city:
is_delivery_address:
is_home_address:
is_work_address: true
is_billing_address:
other_address_info:
street2:
fax:
phone:
---
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment