-1
我想這樣做像水木清華:Rails的哈希添加到現有的哈希
a = Hash.new
a = {:profile => @user}
a[:profile][:contacts] = Hash.new
a[:profile][:contacts] = @user.contacts.all
但我得到的錯誤不能寫未知屬性'接觸。我們的數據庫中有select
的結果。 我需要創建一個散列這種結構
[:profile][:name] = boris
[:profile][:sex] = 1
[:propfile][:contacts] = here anotrher hash