Hi all, for instance, A has_and_belongs_to_many B, And in my action, I want to get a page of Bs associated to A. How can I get this done? Currently, I use code like this in my action: @tag = Tag.find_first [''name = ?'',@params[''id'']] @blog_pages, @blogs paginate :blog, :order_by => ''blogs.created DESC'',:per_page=>2, :join=>"JOIN blogs_tags on (blogs_tags.blog_id=blogs.id <http://blogs.id>and blogs_tags.tag_id=#{@ tag.id <http://tag.id>})" It works, but ugly! Is there a best practice on this condition? Another Problem, I use <%= pagination_links @blog_pages%> in my view to generate paginator links, but it generated links like this: http://127.0.0.1:3000/?page=2,not expected http://127.0.0.1:3000/site/show_tags/xxxx?page=2. Is this a bug of Rails 0.13? or I did something wrong? -- Regards. Yufan _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails