Given this chunk of ajax
that calls FriendsController@destroy
$.ajax({
url: '/dashboard/friends/' + id,
type: 'DELETE',
data: { src: 'show' },
success: function(response) {
}
});
How can I return Redirect::route('dashboard.friends.index')
inside FriendsController
after the delete procedure is completed? I guess this is trying to return the response back to AJAX which doesn't know how to react.
I could just window.location.href = '/dashboard/friends'
but I want to Flash a success message to the view which I can't do with AJAX.