$(document).on('turbolinks:load', function() { $(".tags-selected_multi").each(function () { $(this).select2({ multiple: true, maximumSelectionLength: 3, // // width: 300, placeholder: '请选择技术平台', allowClear: true }) }) }); function update_change(target) { var s_id = $(target).attr("data-id"); var s_value = $(target).val(); var s_name = $(target).attr("name"); var json = {}; var s_index = $(target).parent("td").siblings(".shixun-line-no").text(); json[s_name] = s_value; json["page_no"] = s_index; $.ajax({ url: "/admins/shixun_settings/" + s_id, type: "PUT", dataType:'script', data: json, success: function (data) { } }) }