Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails datatables ajax json 414 request URI too large

So I've tried the Railscasts tutorial, as well as the one for the ajax-datatables-rails gem. I'm creating a list of clients from a database--not users. I believe I've narrowed it down to the fact that when using the GET method via Datatables' sServerMethod, I receive a 414 with "Request-URI too large". When I use the POST method, I simply get null values for all attributes except id which makes sense since the POST json is used for creating a client. Any help is greatly appreciated!

Here is my code and diagnostics response:

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

Response:

http://127.0.0.1:3001/clients.json
Request-URI Too Large
like image 403
Tomanow Avatar asked Apr 12 '13 00:04

Tomanow


1 Answers

Managed to fix the error by installing the gem thin.

Add this line to your Gemfile if you are having this issue:

gem 'thin'
like image 196
Tomanow Avatar answered Sep 29 '22 08:09

Tomanow