Sha256: 19f6940ceac499854b7bcfea3e5909d5a8b78ffdcac6ee3ea295e09b8ae4fff8

Contents?: true

Size: 740 Bytes

Versions: 1

Compression:

Stored size: 740 Bytes

Contents

class ParentModel < ActiveRecord::Base
  has_many :child_models
  has_many :second_child_models
  accepts_nested_attributes_for :child_models,
                                :allow_destroy => true,
                                :reject_if => proc { |attrs| attrs['name'].blank? }
  accepts_nested_attributes_for :second_child_models,
                                :allow_destroy => true,
                                :reject_if => proc { |attrs|
                                  attrs['first_name'].blank? &&
                                  attrs['last_name'].blank? &&
                                  attrs['address'].blank? &&
                                  attrs['some_flag'].blank?
                                }
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
view_mapper-0.3.4 test/views/has_many/expected_templates/parent_model.rb