I do this but i get a systax error. Maybe i'm doing something wrong. I
wrote this:

@cat_products = Product.paginate(:per_page => 5, :page => params
[:page],
                                 :conditions => {['title like ?' , "%#
{params[:search]}%"], :category_id => params[:id]},
                                 :order => 'title')

Any ideas???
Thanx

On Sep 20, 12:05 am, Colin Law <[email protected]> wrote:
> 2009/9/19 Kostas L. <[email protected]>:
>
>
>
>
>
> > Hi guys!
> > I am using will_paginate in my rails application.
> > I want to merge these 2 lines in one:
>
> >   �...@cat_products1 = Product.find(:all, :conditions => {:category_id
> > => params[:id]})
> >   �...@cat_products2 = Product.paginate(:per_page => 5, :page => params
> > [:page],
> >                                 :conditions => ['title like ?' , "%#
> > {params[:search]}%"],
> >                                 :order => 'title')
>
> > I want to paginate using the condition category_id=>params[:id]
>
> > Any sollutions???
>
> Can't you just include the category_id in the conditions for the
> paginate call?  Or am I missing something?
>
> Colin
--~--~---------~--~----~------------~-------~--~----~
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