changed controller for not showing deleted records

When we delete record on the edit page it redirects you to index page. The record seems to be deleted on server side but it was shown on client side before reloading browser. 
This commit will change this. After deleting record it is deleted on client and server side.