Rails 4, cocoon gem destroying created objects -


i have big problem in applications. it's little complicated try explain deeply. in application have model "car":

class car < activerecord::base    has_many :prices,  dependent: :destroy    accepts_nested_attributes_for :prices, allow_destroy: true  end 

and "price":

class price < activerecord::base   belongs_to :car end 

im using wicked gem have wizard form. im use cocoon gem create nested objects. "payment step html":

= simple_form_for [:partners, @car], url: wizard_path |f|   = f.simple_fields_for :prices |price|     = render 'price_fields', f: price   #links     = link_to_add_association 'add price', f, :prices   = link_to t('cars.back'), edit_partners_car_path(@car)   = f.submit t('cars.next'), class: 'btn btn-primary' 

and price_fields:

.nested-fields   %table.table.table-striped.table-bordered     %thead       %th         = f.input :from_days       %th           = f.input :to_days       %th         = f.input :netto_price     = link_to_remove_association "x", f 

and problem when create prices , go next step prices saved databse , fine. when come step , click my:

= link_to_remove_association "x", f 

it hide object not delete database. it's big problem me. can't find issue. please if can.

i change "_price_fields" to:

.nested-fields   %table.table.table-striped.table-bordered     %thead       %th         = f.input :from_days       %th           = f.input :to_days       %th         = f.input :netto_price   = link_to_remove_association "x", f 

my link_to_remove_association 1 level deep... works charm


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -