Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7562805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:30:15+00:00 2026-05-30T13:30:15+00:00

I have a comment model under a micropost. I was wondering if I can

  • 0

I have a comment model under a micropost. I was wondering if I can paginate this so that 50 comments won’t show all at once once the comment button is clicked on the micropost. I am pretty sure this cannot be paginated but is there a way that like facebook, only a certain amount shows and then the user can show more if they please. Currently my code looks like this:

Micropost HTML for the Comment Section

<div id='CommentContainer-<%= micropost.id%>' class='CommentContainer Condensed2'>
<div class='Comment'>
<%= render :partial => "comments/form", :locals => { :micropost => micropost } %>
</div>
<div id='comments'>
<%=render micropost.comments %>
</div>
</div>

When a button above is clicked it shows this section and I would not like 50 comments to show up all at once. All suggestions will be very helpful. Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T13:30:17+00:00Added an answer on May 30, 2026 at 1:30 pm
    1. Make sure you are calling @comments = Comment.paginate(:page => params[:page], :per_page => 10) in your controller
    2. You render the group through the <%= will_paginate @comments %> call and not through :render and then later through will_paginate
    3. Since I already know you are using nested partials. I would make sure that the item you are calling has the correct collection. After those three things are met, it should be working fine.

    You can also be sure to checkout the railscast on will_paginate although without a pro subscription you may have to watch the outdated version.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a comment model that posts under a micropost like facebook. The problem
I have a Comment Model that I am using to store comments for both
I have this link @Ajax.ActionLink(comment, CreateDebateComment, new { id = Model.DebateID}, new AjaxOptions {
Assuming I have a comments model and a posts model, What code can I
I have comment model that references (foreign key) a post model and there is
I have a comment model with string property like this: [Column] public string Text
I have an article controller that deals with articles. I have a comment model
I have article model with public ICollection<Comment> Comments { get; set; } and comment
I have a simple Video model in my rails app that has_many comments. I
I have a comment model. I am creating a new instance of that model

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.