2013-03-26 112 views
1

我想寫我在哪裏尋找獲取與模型獲取與模型關聯嵌套的屬性

對於如

class Category < ActiveRecord::Base 

accepts_nested_attributes_for :devices, :books 

#other association and code is not written here 

end 

相關的嵌套屬性的更清潔的方式測試案例之一我預計

$ Category.get_nested_attributes #this is a dummy method 
$ ["devices","books"] #this is the return i expect 

是否有任何已有的幫助方法?如果是,請讓我知道。 :)

感謝

回答