爲railstutorial編寫sample_app並出現下一個錯誤。will_paginate NoMethodError
我已經添加<%= 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'
問題出在哪裏?
''users_controller.rb'的第17行輸出是? – Jonathan 2012-04-17 13:53:47
@microposts = @ user.microposts.paginate(:page => params [:page]) – earsonheart 2012-04-17 13:54:49
1.哪個動作是用於分頁的? 2.您如何在'Gemfile'中聲明* will_paginate *的gem? 3.是否爲用戶has_many:microposts和microposts belongs_to:user設置了關聯? 4.你使用的是什麼版本的Rails? – Jonathan 2012-04-17 13:58:51