# Pagenation to list selected items

**URL:** <https://www.ruby-forum.com/t/pagenation-to-list-selected-items/126333>\
**Category:** Rails\
**Created:** [January 17, 2008, 2:59pm UTC](https://www.ruby-forum.com/t/pagenation-to-list-selected-items/126333 "2008-01-17T14:59:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![madhan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/aca169/32.png) [@madhan](https://www.ruby-forum.com/u/madhan)\
**Post date:** [January 17, 2008, 2:59pm UTC](https://www.ruby-forum.com/t/pagenation-to-list-selected-items/126333/1 "2008-01-17T14:59:41Z")

</div>

hi all,  
i want to display 5 orders in a page from an orders table. so i used…

i m getting startDate and endDate as parameters.

@orders\_pages, @orders = paginate(:orders, :conditions =\>[“ordered\_on \>  
? and ordered\_on \< ?”,startDate, endDate])

if i get a collection of 15 orders, it displays first 5 order  
correctly… but if i press the ‘next\_page’ link it says undefined  
variable startDate.

plz guide me to solve this problem…

thanks in advance.  
madhan
