472,125 Members | 1,575 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,125 software developers and data experts.

Pagination in Ruby on Rails

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 6546
16,027 Expert Mod 8TB
Take a look at the will_paginate gem/plugin.
Jul 7 '08 #2
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 leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.