Have you tried will_paginate?  Ryan Bates has a wonderful screencast
at
http://railscasts.com/episodes/51
Also the will_paginate google group is helpfull.  In the screencast
ryan bates shows how to put the pagination
in the model

Best wishes - Owen

Erol Fornoles wrote:
> On Oct 9, 8:17�pm, Sreejith Padmanabhan <[EMAIL PROTECTED]
> s.net> wrote:
> > yeah i tried it,
> >
> > but i am not able to get the output.
> >
> > can u help me
> > i am attaching the controller file with this.
> >
> > class SearchController < ApplicationController
> > def search
> > searchvalue=params[:searchtextfield]
> >
> > @nejmvalue=NEJM.find(:all, :conditions=> ["keywords like
> > ?",'%'+searchvalue+'%'],:order =>'author ASC')
> >
> > render(:action =>'search')
> > end
> >
> > def alt_search
> >
> > end
> >
> > end
>
> You could do something like this in your controller:
>
> @nejmvalues = NEJM.paginate :page => params[:page], :per_page =>
> 10, :conditions => ["keywords LIKE ?", "%#{searchvalue}%"], :order =>
> "author ASC"
>
> And in your view:
>
> <% paginated_section @nejmvalues do %>
>   ... insert your results here ...
> <% end %>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to