Making a table row into a link in Rails

后端 未结 5 1081
刺人心
刺人心 2020-11-30 02:07

I am trying to make a row in a table link to the edit page. I know the links are being created, because I can print them out. I am close, but am missing something importan

5条回答
  •  野性不改
    2020-11-30 02:22

    Here is my take to make those links, remote: true

    $("tr[data-link]").click(function () {
        $.ajax({
            url: this.getAttribute('data-link'),
            dataType: "script",
            type: "GET"
        });
        event.preventDefault();
    });
    

提交回复
热议问题