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

  • Home
  • SEARCH
  • 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 8046301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:45:00+00:00 2026-06-05T05:45:00+00:00

I’m currently working on a Reddit clone app that I had written in Rails

  • 0

I’m currently working on a Reddit clone app that I had written in Rails 2 and I’m trying to bring it up to speed with new features in Rails 3. The app is very simple, it has a Links scaffold which has :url, :description, :points, and :created_at. The app routes to links#submissions where you can view all submitted links and submit a new link as well.

I’ve run into a problem with the paginate method in Rails 2 when displaying the links on the submissions page. I am currently running Rails 3.2.3 and I understand that I need to use the gem will_paginate in Rails 3 (which I have included in my Gemfile) but whenever I try to pull up localhost:3000 I get this error message:

NoMethodError in LinksController#submissions...
undefined method paginate for #<LinksController:0x00000102ff5f98>

specifically on line 90 of the Links controller.

Here is what I have in my LinksController.rb (lines 90-93).

@link_pages, @Links = paginate :links, :order => order, :per_page => 20
@header_text = case ordering
    when 'hot' then 'Top rated submissions'
when 'new' then 'Latest submissions'

Is this not the correct way to use paginate in Rails 3?

  • 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-06-05T05:45:01+00:00Added an answer on June 5, 2026 at 5:45 am

    For will_paginate, you should use something like this in your controller:

    @links = Link.paginate(:page => params[:page], :per_page => 20)
    

    In your view, the links for the given page will be stored in the @links instance variable. You can iterate over that collection and display the links.

    To show the links to other pages (of links), you use this somewhere in the view:

    will_paginate @links
    

    You can find more help for will_paginate here: https://github.com/mislav/will_paginate

    However, for Rails 3, I prefer kaminari instead of will_paginate. It uses Rails 3 scopes.

    It looks like this in the controller:

    @links = Link.page(params[:page]).per(20)
    

    And this in the view:

    paginate @links
    

    You can read more about kaminari here: https://github.com/amatsuda/kaminari

    Also you can watch Ryan’s Railscast on kaminari here: http://railscasts.com/episodes/254-pagination-with-kaminari

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

Sidebar

Related Questions

I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm trying to create an if statement in PHP that prevents a single post
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

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.