Sha256: 63a2f35094c5d121f3af70e19fd4c20bd660636a9708b6bf2745a84dc3e92ecb
Contents?: true
Size: 764 Bytes
Versions: 21
Compression:
Stored size: 764 Bytes
Contents
function delete_link(id) { link = $(id) if(!confirm(link.data('confirm'))) { return } var href = $.rails.href(link), method = link.data('method'), target = link.attr('target'), csrf_token = $('meta[name=csrf-token]').attr('content'), csrf_param = $('meta[name=csrf-param]').attr('content'), form = $('<form method="post" action="' + href + '"></form>'), metadata_input = '<input name="_method" value="' + method + '" type="hidden" />' if (csrf_param !== undefined && csrf_token !== undefined) { metadata_input += '<input name="' + csrf_param + '" value="' + csrf_token + '" type="hidden" />' } if (target) { form.attr('target', target) } form.hide().append(metadata_input).appendTo('body') form.submit() }
Version data entries
21 entries across 21 versions & 1 rubygems