我有以下型號:表單提交嵌套色器件的用戶數據
class User < ActiveRecord::Base
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable, :encryptable
belongs_to :club
end
和
class Club < ActiveRecord::Base
has_many :users
accepts_nested_attributes_for :users
end
因爲「accepts_nested_attributes_for」必須繼續下去了「的has_many」的一面,我怎麼構建一個嵌套表單,請接受嵌套,設計,用戶數據?
http://railscasts.com/episodes/196-nested-model-form-part-1 – dbKooper