I have a really simple association with the Devise user object where each user has one Profile (with more application specific stuff…) I am having no issues creating the User object and accessing the user and its profile object. i.e.,
@user.profile
However, I’m having an issues when I try to delete the profile object – I’d assume that when I delete the User object, it would also delete each associated object. The association in my User object is like so
accepts_nested_attributes_for :profile, :allow_destroy => true
The has_one and belongs_to associations are set on both the User and Profile objects. Maybe the issues is in Devise code – I’m stumped. An idea what I’m missing here.
You need to specify
:dependenton the association:Look Association for more information.