Rails multiple paginations on view -


i have simple article & comments model relationship.

presently have:

a) article index view displays paginated list of articles

b) article show view displays article , paginated list of comments.

i have view displays paginated list of articles , within each article paginated list of comments each article.

how done within controller? single article , comments can do:

@articles = article.all.page(params[:page]).per_page(10) @comments = @articles.comments.page(params[:page]).per_page(10) 

create partial page comments...inside articles index.html.erb file render partial page

inside index.html.erb use: <%= will_paginate @articles %>  inside _partial.html.erb use: <%= will_paginate @comments %> 

Comments