2014-03-12 24 views
0

我是新來的鐵軌和嘗試使用軌道的敏捷開發樣本, 之後,我試圖通過will_paginate添加分頁, 它在當地工作正常,但不是在heroku, 這裏是我的Heroku鏈接:

http://squarer-bookshop.herokuapp.com/

的PAGINATE就是不工作,頁面停留分頁點擊後相同。 我只是做:will_pagination在本地工作,但不是在heroku

def index 
    @products = Product.paginate(:per_page => 4, :page => params[:page]).order('title') 
end 

和index.html.erb

<%= will_paginate @products %> 

任何建議表示讚賞!

+0

這將是標準的行爲,如果你已經安裝will_paginate gem是在你的系統上,但沒有捆綁在你的gemfile中。你在你的gemfile中添加了「gem'will_paginate'」嗎​​? –

+0

此外,把分頁方法最後,「命令(..)」後 –

+0

我在我的gemfile中有「gem'will_paginate'」。 – squarer

回答

1

今天碰巧發現它怎麼我有<%緩存辦%>在索引頁, 只是將其刪除或禁用緩存production.rb

config.action_controller.perform_caching = false 
相關問題