[size=medium]需要做两个表的分页显示,两个表在一个页面上,通过切换来交替显示,需要做到两个页面显示的页数互不干扰,也就是说如果表2在第一页,切换到表1,表1选择显示第三页,又切换到表2,需要表2显示第一页。[/size]
=will_paginate @first_details, :param_name => 'table1_page', :previous_label => '<<' , :next_label => '>>', renderer: BootstrapPagination::Rails
=will_paginate @second_details, :param_name => 'table2_page', :previous_label => '<<' , :next_label => '>>', renderer: BootstrapPagination::Rails
// 因为默认的是:param_name=> page, 那么在一个页面,做两个表的分页显示时,会使两个表的页码一样。所以,需要在分页的部分重新指定param_name。
@first_details = active_push_message.fetch_active_push_message_history_details(true).paginate(page: params[:table1_page],:per_page => 15)
@second_details = active_push_message.fetch_active_push_message_history_details(false).paginate(page: params[:table2_page],:per_page => 15)