Will_paginate NoMethodError

Writing sample_app for the rail manual and the following error.

I added <%= will_paginate @microposts %>View @microposts = @user.microposts.paginate(:page => params[:page])to my user profile and beforeUsersController

> NoMethodError (protected method `wp_parse_options' called for #<Class:0x007fde66015a80>):
  app/controllers/users_controller.rb:17:in `show'

Where is the problem?

+3
source share
1 answer

Try gem 'will_paginate', '~> 3.0'and install the package again, restart the server. Give paginate some extra parameters just for the heck of itpaginate(page: params[:page], per_page: 15)

+4
source

All Articles