Skip to content

Instantly share code, notes, and snippets.

View zaeem's full-sized avatar

Zaeem Asif zaeem

  • San Francisco, CA, USA
View GitHub Profile
@ansnisar
ansnisar / assign_vendor.rb
Last active May 25, 2018 17:58
Rails: Multi-level nested form (has_many association with checkboxes)
# Bridge table between vendors & users
class AssignVendor < ActiveRecord::Base
belongs_to :vendor
belongs_to :user
has_many :assign_vendor_docs
has_many :vendor_files, through: :assign_vendor_docs
accepts_nested_attributes_for :assign_vendor_docs, allow_destroy: true
end