开发者

pagination in jruby

开发者 https://www.devze.com 2023-03-12 22:55 出处:网络
I am using jruby, i want use pagination for my rails app i used will_paginate but i think jruby does not support\'s for will_paginate.

I am using jruby, i want use pagination for my rails app

i used will_paginate but i think jruby does not support's for will_paginate. it gives error "undefined method `total_pages' "

in my units_controller.rb
 @units = Unit.paginate(:page => params[:page], :order 开发者_如何学Python=> 'created_at DESC')

and in views(index)
<%= will_paginate  @units%> 

is there some other pagination gem which support jruby, because i read in doc of will_paginate in that it state that will_paginate may support jruby not sure plz help


You can try kaminari and look at this railscast for an introduction

0

精彩评论

暂无评论...
验证码 换一张
取 消