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 rubyonrails-talk@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---