will-paginate

jQuery call for a partial doesn't work if there is RoR code in it?

Hi, I am trying to get paginating to work with jQeury. I am using the will_paginate gem. It works normally (with no javascript). I tried following a railscast (http://railscasts.com/episodes/174-pagination-with-ajax) but I am still having a problem. show.js.erb $('#comments').html("<%= escape_javascript(render "comments/comment.html.e...

Paginate in rails

Hi, I'm new to rails and I want to know about paginate method in rails. How can I do pagination in rails. Thanks ...

will paginate, nested routes, ruby, rails

I'm trying to get will paginate to link to my nested route instead of the regular posts variable. I know I'm supposed to pass some params to paginate but I don't know how to pass them. Basically there is an array stored in @posts and the other param paginate has access to is category_id. The nested route is /category/1/posts but hittin...

What's special about :conditions => [a_field IN (.., .., ..)] ?

The following result sets work well with will_paginate: Members.all(:limit => 5).paginate(:page => params[:page]) Members.all(:conditions => ["member_no < 6"]).paginate(:page => params[:page]) Members.all.paginate(:page => params[:page]) The following does not: Members.all(:conditions => ["member_no IN (?)", [1, 2, 3, 4, 5]]).paginat...

Mongoid Pagination problem

Hi, I'm struggling to paginate using mongoid. I'm able to call paginate on my collection object like @results = @collections.paginate :page => 1, :per_page => 10 but how it needs to be referred in view? In my view I have rendered the collection in partial as <%= render :collection => @collections, :partial => collect.xml %> <%= will...

will-paginate issues for searchresults in ruby on rails

hi guys, my search results are stored in the @searchresults variable as subarrays - for example it has 3 sub-class of results books, people, carnames, such that each of this results are available in the search result as @searchresults[:books_results] etc,. I need some help on how to apply the will_paginate for these sections (books, peo...

Will_Paginate --- Set the Starting record ?

Hello! I have a photo_album which has several photos, IDs: 4,9,10,11,31 -- all for photo_album:3 I have the following for my DEF SHOW in my Photos controller: @photo = @photoalbum.photos.order("created_at ASC").paginate :page => params[:page], :per_page => 1 Problem is, if the URL is: /photo_albums/3/photos/10 The code above starts ...