Suketa
Suketa

Reputation: 67

how to destroy the different corresponding ids of different connected tables from one interface's destroy

if my model is like:

class ss < ActiveRecord::Base has_many :ss_schedules end

class ssSchedule < ActiveRecord::Base belongs_to :ss end

class ssRuleMapping < ActiveRecord::Base belongs_to :ss belongs_to :ss_rules end

Upvotes: 0

Views: 46

Answers (1)

Awea
Awea

Reputation: 3173

In your model association try something like this :

has_many :models, :dependent => :destroy

You can find documentation about this here and here

If you want help, edit your post with the code of concerned models

Upvotes: 1

Related Questions