memaker / ttv4

Tweet analysis tool version 4, implementing graphical dashboard
0 stars 2 forks source link

Clean the associated tweets when a 'term' is deleted by the user #5

Closed memaker closed 11 years ago

memaker commented 11 years ago

When a 'term' is deleted, we shall delete all its associated tweets

memaker commented 11 years ago

I have added this code to the 'term' controller

DELETE /terms/1

DELETE /terms/1.json

def destroy @term = Term.find(params[:id])

## it also deletes the associated tweets
@tweets = @term.tweets
@tweets.destroy_all

@term.destroy