简体   繁体   中英

will_paginate current page is always 1

Im using will_paginate and the problem Im having is when I click on a specific page number in the will_paginate selection. The page reloads with the page=2 if clicking 2 on the selection for example. However on the selection it is still selected as page 1 . The selection never changes.

在此处输入图片说明

 <%= will_paginate @reservations %> 

I removed the css from the pagination and still having the same problem.

@reservations = user.reservations.order(updated_at: :desc).page(params[:page_pending]).per_page(10)

also tried:

@reservations = user.reservations.order(updated_at: :desc).paginate(page: params[:page_pending]).per_page(10)

请在Controller->“索引操作”中将查询更改为此吗?

@reservations = user.reservations.order(updated_at: :desc).paginate(page: params[:page], per_page: 30)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM