How can I use two paginations inside one page and make them work separately? For example, see the image below:
On the top of the image are two paginations: 1st on the left and the 2nd on the right. If I click on the 1st pagination, then I only need the data on the 1st pagination to load without the whole page being loaded; the 2nd one should stay the same and be separated.
Below is my controller code for the data shown:
@first= Post.paginate(page: params[:page], :per_page => 4).order('post_id DESC')
@second= Post.paginate(page: params[:page], :per_page => 4).order('post_id ASC')
Pagination will_paginate