Forum: Ruby on Rails HABTM & pagination confused

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Abhishek shukla (Guest)
on 2009-02-11 08:45
(Received via mailing list)
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
Master Chief 2007 (Guest)
on 2009-02-11 09:03
(Received via mailing list)
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

Caveat: I am a noobie to Rails .. just trying to help.
--
View this message in context:
http://www.nabble.com/HABTM---pagination-confused-...
Sent from the RubyOnRails Users mailing list archive at Nabble.com.
MaD (Guest)
on 2009-02-11 10:06
(Received via mailing list)
> Caveat: I am a noobie to Rails .. just trying to help.

but still, you're right. mislav-will_paginate is the way to go.
Abhishek shukla (Guest)
on 2009-02-11 11:48
(Received via mailing list)
Thanks bro got the solutions

@students = Seminar.find(params[:id]).students.paginate (:page =>
params[:page], :per_page => 10)
This topic is locked and can not be replied to.