开发者

delete confirmation in ruby-on-rails using jQuery UI dialog to make normal http request

I am showing delete confirmation box using jQuery UI dialog. But on del开发者_如何学JAVAete I don't want to make any ajax call when user click on delete, as after deleting I want to redirect to home page. The delete should make normal http request with method delete. How can I achieve it?

$("#delDialog").dialog({
    autoOpen: false,
    width: 300,
    modal: true,
    resizable: false,
    buttons: {
            "Delete": function() {
                if (gohome) // redirect to home
                    {
                        //here I want to make normal call to delete post without using .post/.get/.ajax
                        $(this).dialog("close");
                    }
            },
            "Cancel": function() {
                $(this).dialog("close");
            }
        }
    });


Im pretty sure ryan from railcasts.com shows you how to exactly what your after in one or two of his screencasts.

Have a squiz, because I ws looking at using html delete requests without an ajax call and saw his way on his screencasts.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜