# HABTM & pagination confused

**URL:** <https://www.ruby-forum.com/t/habtm-pagination-confused/160036>\
**Category:** Rails\
**Created:** [February 11, 2009, 7:45am UTC](https://www.ruby-forum.com/t/habtm-pagination-confused/160036 "2009-02-11T07:45:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abhishek\_shukla](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7cd45c/32.png) [@Abhishek\_shukla](https://www.ruby-forum.com/u/Abhishek_shukla)\
**Post date:** [February 11, 2009, 7:45am UTC](https://www.ruby-forum.com/t/habtm-pagination-confused/160036/1 "2009-02-11T07:45:13Z")

</div>

Hello friends,

Here is my code though which i am getting value

@students = []  
Seminar.find(params[:id]).students.each do |student|  
@students \<\< student  
end

As now i want to implememt pagination… But no idea how should i  
implement.

Thanks  
Abhi

---

<div class="post-metadata">

**Author:** ![Abhishek\_shukla](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7cd45c/32.png) [@Abhishek\_shukla](https://www.ruby-forum.com/u/Abhishek_shukla)\
**Post date:** [February 11, 2009, 8:03am UTC](https://www.ruby-forum.com/t/habtm-pagination-confused/160036/2 "2009-02-11T08:03:56Z")

</div>

Abhishek shukla wrote:

> As now i want to implememt pagination… But no idea how should i  
> implement.
> 
> Thanks  
> Abhi
> 
> >

You should explore will\_paginate plugin which is what I intend to do in  
a  
few days when I get to my problem.  
[http://wiki.github.com/mislav/will\_paginate](http://wiki.github.com/mislav/will_paginate)

## Caveat: I am a noobie to Rails … just trying to help.

View this message in context:  
[http://www.nabble.com/HABTM---pagination-confused-tp21949213p21949375.html](http://www.nabble.com/HABTM---pagination-confused-tp21949213p21949375.html)  
Sent from the RubyOnRails Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![Abhishek\_shukla](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7cd45c/32.png) [@Abhishek\_shukla](https://www.ruby-forum.com/u/Abhishek_shukla)\
**Post date:** [February 11, 2009, 9:06am UTC](https://www.ruby-forum.com/t/habtm-pagination-confused/160036/3 "2009-02-11T09:06:06Z")

</div>

> Caveat: I am a noobie to Rails … just trying to help.

but still, you’re right. mislav-will\_paginate is the way to go.

---

<div class="post-metadata">

**Author:** ![Abhishek\_shukla](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7cd45c/32.png) [@Abhishek\_shukla](https://www.ruby-forum.com/u/Abhishek_shukla)\
**Post date:** [February 11, 2009, 10:48am UTC](https://www.ruby-forum.com/t/habtm-pagination-confused/160036/4 "2009-02-11T10:48:57Z")

</div>

Thanks bro got the solutions

@students = Seminar.find(params[:id]).students.paginate (:page =\>  
params[:page], :per\_page =\> 10)
