destroying entities related by foreign key

Check the options for "has_one" and "has_many" (e.g. on page 329 and page 331 in the Second Edition of "Agile Web Development with Rails").

Use "destroy" on the parent object (not delete).

The option to the has_one or has_many you want is:

:dependent => :destroy

or

:dependent => :delete_all

depending on your design. The child row(s) will be destroyed at the time the parent is destroyed.

HTH,

Peter