【问题标题】:Rails datatables ajax json 414 request URI too largeRails数据表ajax json 414请求URI太大
【发布时间】:2013-04-13 06:33:35
【问题描述】:

所以我尝试了Railscasts 教程以及ajax-datatables-rails gem 的教程。我正在从数据库创建一个客户列表——而不是用户。我相信我已经将其缩小到这样一个事实,即当通过 Datatables 的 sServerMethod 使用 GET 方法时,我收到一个带有“Request-URI too large”的 414。当我使用POST 方法时,我只是为除id 之外的所有属性获取空值,这是有道理的,因为POST json 用于创建客户端。非常感谢任何帮助!

这是我的代码和诊断响应:

// custom.js    
$("#datatable").dataTable({
        "bJQueryUI": true,
        "sPaginationType": "full_numbers",
        "bProcessing": true,
        "bServerSide": true,
        "sAjaxSource": $('#datatable').data('source'),
    });

回复:

http://127.0.0.1:3001/clients.json
Request-URI Too Large

【问题讨论】:

    标签: ajax ruby-on-rails-3.2 datatables


    【解决方案1】:

    通过安装 gem thin 来修复错误。

    如果您遇到此问题,请将此行添加到您的 Gemfile

    gem 'thin'
    

    【讨论】:

    • 貌似是因为WEBrick服务器无法处理请求,但是Thin server没有问题。谢谢!
    猜你喜欢
    • 1970-01-01
    • 2013-10-31
    • 1970-01-01
    • 1970-01-01
    • 2017-12-14
    • 2014-03-28
    • 1970-01-01
    • 2019-06-02
    • 1970-01-01
    相关资源
    最近更新 更多