I am fetching some rows from the database in my controller with this query :
@main = connection.execute("select code_ver, result from mastertest;")
Now in my html.erb, I am displaying the results in a table like this:
<% @level1.each do |row1| %>
<table id="tbl_main1" name="tbl_main1">
<tr bgcolor="#D1D1D1">
<td width="60%" <%= row1[0] %>></td>
<td width="20%"><%= row1[2] %></td>
<td width="20%"><%= row1[1] %></td>
</tr>
</table>
I am fetching a lot of rows here. But I want to show only say 15 results at once, and have some kind of buttons 'next' and 'previous' which would cycle through the results. How would I do that ?
will_paginatewould do javascript pagination would save requesting the server again and again as oppose towill_paginate