저는이 기본 질문과 관련된 모든 종류의 충돌 정보를 얻었으며 그 대답은 현재의 내 문제에 매우 중요합니다. 레일스 3에서는 매우 간단하게 belongs_to 관계로 accepts_nested_attributes_for를 사용할 수 있습니까? 뷰에서 belongs_to에서 accepts_nested_attributes_for 작업을 수행합니까?
class User < ActiveRecord::Base
belongs_to :organization
accepts_nested_attributes_for :organization
end
class Organization < ActiveRecord::Base
has_many :users
end
". 중첩 된 속성이 상위을 통해 관련 기록
의 특성을 저장할 수는"문서의 epochwolf이 첫 번째 줄에서 상태를 인용 = 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"
워드 프로세서 http://api.rubyonrails.org/classes/ActiveRecord/NestedAttributes/ClassMethods.html은'언급하지 않습니다. 너는 그것을 시도하고 우리에게 돌아가 보지 그래? – epochwolf