コメント用にリソースコントローラを使用しています。 ブレードのコメントを削除するリンクがあります。laravelのjqueryを使用してリソースコントローラのdestroyメソッドにリダイレクトすることはできますか?
<a href="" ><span class="glyphicon glyphicon-trash delete"></span></a>
私はそれにjqueryのダイアログ・ポップ・アップをクリックします。ダイアログボックスのコードは次のようになります。
jQuery(document).ready(function($){
$('.edit-delete span.delete').click(function(e){
e.preventDefault();
$('<div id="dialog" class="pull-center"></div>').appendTo('body').html('<div"><h4>Are you sure you want to delete this comment?</h4></div>')
.dialog({
autoOpen: true,
modal : true,
title : 'Confirm',
buttons: {
"Yes" : function(){
$(this).dialog('close');
$(location).attr("href", " {{what do i put here?}} ");
},
"No" : function(){
$(this).dialog('close');
}
}
});
});
});
しかし、我々はそれを達成するためにmethod.Howを削除使用する必要として機能しませんリダイレクト驚き?あなたはlaravelルートへのリンクをお勧めしますあなたの{{what do i put here?}}
セクションで