0

我正在使用 :reject_if 拒绝我的字段以保存在 DB 中。这是我的代码

accepts_nested_attributes_for :profiles,
    :reject_if => proc { |a| a[:name] == "Name"},
    :allow_destroy => true

我正在使用嵌套形式。

4

1 回答 1

0

你有 attr_accessible 吗?

如果是这样,您需要包括

  attr_accessible :profiles_attributes
于 2012-05-25T07:54:17.440 回答