Я получал различного рода противоречивую информацию по этому базовому вопросу, и ответ на него очень важен для моих текущих проблем. Итак, очень просто, в Rails 3, разрешено или нет использовать accept_nested_attributes_ for a belong_to relationship?
class User < ActiveRecord::Base
belongs_to :organization
accepts_nested_attributes_for :organization
end
class Organization < ActiveRecord::Base
has_many :users
end
В виду:
= form_for @user do |f|
f.label :name, "Name"
f.input :name
= f.fields_for :organization do |o|
o.label :city, "City"
o.input :city
f.submit "Submit"