List Info

Thread: Tutorial for Queries




Tutorial for Queries
user name
2006-08-26 07:04:22
Max Muermann wrote:
>>
>> I want to basically list out all the books by
authors with names like
>> 'jim' - prefer to have this paginated so that I can
use my basic
>> paginated list view.  However, this throws up an
exception:
>>
>
>
> book_pages, books = paginate(:books,
>                                                 
:per_page => 20,
>                                                 
:conditions
> =>['author.name like ?', '%jim%],
>                                                 
:include=>:author
>                                                 
:order_by => 
> sort_order)
>
> Note the :include option. You may want to look that up
in the rails
> docs - this is off the top of my head, I might have the
naming
> slightly wrong.
>
> Max
>
Hi Max,
Thanks for your suggestions - I apologize for replying this
late, but my 
site/ email had died for a while!

Cheers
Mohit.

_______________________________________________
Rails mailing list
Railslists.rubyonrails.org
h
ttp://lists.rubyonrails.org/mailman/listinfo/rails
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )