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 6241477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:46:29+00:00 2026-05-24T11:46:29+00:00

I am working with will_paginate plugin in Rails 3 and I am trying to

  • 0

I am working with will_paginate plugin in Rails 3 and I am trying to get to some variable the count of pages (total_pages).

I thought the total pages is in globally variable @total_pages, or in @option[:total_pages]**, but if I will use this variables in my view, so it don’t work.

I know, I can get the total pages of my items in DB table separately by this plugin, but couldn’t be so elegant, if I will have that value already stored in some variable by plugin…

So I would like to ask you – exist any way, how to get this value throw will_paginate plugin?

  • 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-24T11:46:30+00:00Added an answer on May 24, 2026 at 11:46 am

    if you have a posts model,

     <%= @posts.total_pages %>
    

    will give you the pages total, i.e you need to reference the model you’re calling will_paginate on

    http://rdoc.info/github/mislav/will_paginate/master/WillPaginate/Collection

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

Sidebar

Related Questions

I'm trying to get will_paginate working with Sinatra and I have a stange problem
I'm working with the Rails mislav-will_paginate plugin to paginate my records. I want to
I'm using the will_paginate gem for my Rails project and it's working beautifully. Unfortunately,
So I'm trying to use will_paginate-rails3 and its not working out here's what I
I am trying to ajaxify will_paginate result in rails 3.1. I have gone through
I'm pulling my hair out trying to get a jQuery script working that will
I'm using will_paginate for pagination, which has been working well so far, except for
Does anyone have the same problem or a working solution? I get always this
I am using will_paginate to paginate the comments in my Rails 3 app and
I am trying to use jQuery with Rails and AJAX to accept a post

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.