I have a table Bmp with these associations
class Bmp < ActiveRecord::Base
#associations
has_many :subareas, dependent: :destroy
belongs_to :scenario
and another table Subareas
class Subarea < ActiveRecord::Base
#associations
belongs_to :scenarios
belongs_to :soil
belongs_to :bmp
however, when I try to delete a bmp, it should delete my subarea as well, but it is not doing so.
def destroy
@bmp = Bmp.find(params[:id])
@bmp.destroy
I don't see where I've messed up, any ideas are greatly appreciated!