在routes.rb我设置列表routes.rb作为根:
root to: "lists#index"
我希望will_paginate创建页面href指向/?page=#而不是/lists?page=# 。 要创建分页链接,我在“lists#index”文件中有以下行:
<%= will_paginate @lists %>
In the routes.rb I set lists#index as the root:
root to: "lists#index"
I would like will_paginate to create page hrefs pointing to /?page=# instead of /lists?page=#. To create the paginate links I have the following line in the "lists#index" file:
<%= will_paginate @lists %>
最满意答案
我从你的问题中了解到你正在尝试创建一个自定义渲染器,尽管我从未使用它,但为此你需要重写渲染器的链接方法。 这里是链接到原始代码可能会有所帮助 - https://github.com/voormedia/paginary/blob/master/lib/paginary/helpers/pagination_helper.rb
What I understand from your question that you are trying to create a custom renderer, although I have never used it, but for that you need to override the link method of renderer. here is the link to the original code might be of some help - https://github.com/voormedia/paginary/blob/master/lib/paginary/helpers/pagination_helper.rb
更多推荐
发布评论