小编Mic*_*ael的帖子

无法将nil转换为数组will_paginate

你好伙计我在rails 3中遇到了will_paginate的问题,我在我的constroller里有这个

@posts = Post.paginate(:all,
  :include => [:author, :categories],
  :conditions=>"status = 'published'", 
  :order=>"blog_posts.created_at DESC",
  :per_page => 1, :page => params[:page])
Run Code Online (Sandbox Code Playgroud)

和@%= will_paginate @posts%>在我的视图中,但我得到此错误无法将nil不断转换为数组.

谁能帮我 ?

提前致谢

ruby-on-rails

6
推荐指数
2
解决办法
3547
查看次数

标签 统计

ruby-on-rails ×1