Everything is working fine but I am not seeing already existing records in prices for Cake in cocoon form. So I am unable to edit / delete existing records but able to add new prices from edit form.
class Cake < ApplicationRecord
has_many :prices, as: :item
accepts_nested_attributes_for :prices, reject_if: :all_blank, allow_destroy: true
end
class Price < ApplicationRecord
belongs_to :item, polymorphic: true
belongs_to :size
has_and_belongs_to_many :shapes
end
Everything is working fine but I am not seeing already existing records in prices for Cake in cocoon form. So I am unable to edit / delete existing records but able to add new prices from edit form.