3

为 railstutorial 编写 sample_app 并出现下一个错误。

我已添加 <%= will_paginate @microposts %>到用户个人资料视图@microposts = @user.microposts.paginate(:page => params[:page])UsersController

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

哪里有问题?

4

1 回答 1

4

再次尝试gem 'will_paginate', '~> 3.0'捆绑安装,重新启动服务器。给分页一些额外的参数只是为了它paginate(page: params[:page], per_page: 15)

于 2012-04-17T14:38:39.010 回答