如何让paginate工作而不是重定向到’public / index.html’?

我的主页使用’public / index.html’,它覆盖了我在这里阅读的所有内容。

因此,我已将所有已登录的用户重定向到http://localhost:3000/home ,我将其定义为get '/home' => 'static_pages#home', :as => :home in my路线

我面临的问题是,在登录用户(/ home)的主页上,有分页。

当我尝试点击第2页http://localhost:3000/?page=2 ,它会被发送到public / index.html。

我尝试了链接http://localhost:3000/home/?page=2作为测试,但它给了我一个空白的分页。 没有显示任何项目。 我怎样才能解决这个问题?

这是控制器

 class StaticPagesController  1, :per_page => 10) else redirect_to root_path end end 

然后在我看来

    

这是_item.html.erb部分

 <li id="">    posted   made a comment    
shared this
150, :omission=>' ...(continued)') %>