For example, I have two models Person and Address, that one person has
one
address.
class Person < ActiveRecord::Base
has_one :address
end
class Address < ActiveRecord::Base
belongs_to :person
end
Now, I want to write a form to create a person including an address
Name
<%= text_field 'person', 'name', :size => 10 %>
......
Country
<%= text_field 'person', 'address.country' %>
# i think it will
map
to person.address.country, but it doesn't work, how can i do it?
......
–
http://rubyforge.org/projects/ropenwiki/