469,328 Members | 1,280 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,328 developers. It's quick & easy.

Pagination in Ruby on Rails

Hello,
I have generated ruby reports for my application.For html display of report,i have to use next,previous links for navigation.I need to have 10 records per page.And when click on next link,i should be able to retrieve the next 10 records.For retreiving records, i have used find_by_sql query.By this i can limit the records,but displaying other records in next page,i am not able to do.
How can i do this.Please help me.Its urgent.

Thanks in advance
Jul 7 '08 #1
2 6305
acoder
16,027 Expert Mod 8TB
Take a look at the will_paginate gem/plugin.
Jul 7 '08 #2
improvcornartist
303 Expert 100+
Rails did have built in pagination, which would work, but it was deprecated in Rails 2.0. Otherwise, you will probably want to use the will_paginate plugin mentioned above or write pagination by hand using variables to track your current location in the records. Might just depend how complicated or elegant you want it.
Jul 8 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

23 posts views Thread by flab ba | last post: by
65 posts views Thread by Nikolas Hagelstein | last post: by
65 posts views Thread by Amol Vaidya | last post: by
5 posts views Thread by Matias | last post: by
9 posts views Thread by Erwin Moller | last post: by
1 post views Thread by LinkExchange.AB | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by listenups61195 | last post: by
reply views Thread by Purva khokhar | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.