Warning : This website is not updated anymore. Its content surely is outdated.


All the documents in this page are published under a Creative Commons Attribution licence.

More tutorials exist, but they are only available in french.

How to paginate, sort and search a table with Ajax and Rails

This tutorial tries to show how to use Ajax with Rails in order to display a table of items with several functionalities : pagination (split the table on several pages), sorting (table ordering by one of its column), searching (selecting items to be displayed with a query).

This is a very common task in web application development. The interest to use Ajax for this is to provide a dynamic interface which doesn't need to reload the entire page when the table changes. The interest of using Rails is... well, if you are reading this you should already know, but Ajax is really nicely integrated with Rails, and using it is very easier with this great framework.

Note : Thanks to Juan Lupión, a spanish translation is now available.