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 %>
任何建議表示讚賞!
這將是標準的行爲,如果你已經安裝will_paginate gem是在你的系統上,但沒有捆綁在你的gemfile中。你在你的gemfile中添加了「gem'will_paginate'」嗎? –
此外,把分頁方法最後,「命令(..)」後 –
我在我的gemfile中有「gem'will_paginate'」。 – squarer