Given your code ...
def destroy @owner = Owner.find(params[:id]) @owner.destroy flash[:notice] = "Owner Deleted Successfully" respond_with(@owner) end def show @owner = Owner.find(params[:id]) @owner.errors end
At the moment when you are trying to access errors, they will not be.
Errors are temporary. They are not saved with the object, and they do not cross requests. They exist only on the model in the same query that generated the errors.
The only point in your code where errors will be available inside destroy , after , you call @owner.destroy . They will never be available inside your show action.
def destroy @owner = Owner.find(params[:id]) @owner.destroy
source share