Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
新的和很酷的语法让我可以写:
link_to some_path, :remote => true
生成 AJAX 请求。但是如果我需要更长的超时时间(例如 100000 毫秒),我在哪里可以设置呢?我读了link_to,但什么也没找到。
You can use $.rails.ajax property from jquery-ujs, to inject the timeout if it has not been passed explicitly:
$(function() { // ... $.rails.ajax = function(options) { if (!options.timeout) { options.timeout = 100000; } return $.ajax(options); }; // ... });