Displaying 1 result from an estimated 1 matches for "category_product_pag".
Did you mean:
category_product_pages
2006 Jul 11
1
Has And Belongs To Many and Pagination
...s (a many to many relationship.)
When I go to a category page, I wish to load all products associated
with that category and have pagination of the products.
@category_products = @category.products gives me all the products
associated with the category however, when I try to setup pagination:
@category_product_pages, @category_products = paginate :products,
:per_page => 10
I get back all the products no matter what category I''m in. I''m assuming
it is because :products is just returning all products in the database.
What should I be using instead?
Help! (this is my third day on rails...