I have an activity feed in a Rails 3 app and it updates whenever someone adds a comment or posts something. The feed is clickable and takes the user to the item. However, if the item is deleted, the link that remains on the feed is now “dead” and it crashes the app when the page (the one containing the feed) is loaded.
How can I have the dead link redirect to a “this item has been deleted” page instead of linking to the dead item?
In the ItemsController: