[英]Rails - Disable Nested Attributes in Mongoid / Active Record
In Mongoid embedded documents accepts nested attributes
is on by default. 在Mongoid中,默认情况下,嵌入式文档
accepts nested attributes
。 How can one disable it? 如何禁用它?
也许尝试使用attr_protected
宏?
您可以使用attr_protected
限制给定属性attr_protected
大规模分配,也可以使用反attr_accessible
允许仅给定属性大规模分配。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.