-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