I'm using the will_paginate
gem and currently have a list that is already paginated.
@businesses = Business.paginate(:page => params[:page], :per_page => 7)
<%= will_paginate @businesses %>
<% @businesses.each do |business| %>
To display the comments for a particular entry I use:
<% @business.comments.each do |comment| %>
I thought something like the following might work but it didn't:
@business.comments = Business.comments.paginate(:page => params[:page], :per_page => 7)
<%= will_paginate @business.comments %>
I can't seem to find any answer to paginating the comments (99.9% sure its to do with it being @something.something instead of just @something)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…