Need to disable Turbolinks for the pagination buttons.
Simply adding data: { turbo: false } does not seem to work.
<% will_paginate data: { turbo: false } %>
Need to disable Turbolinks for the pagination buttons.
Simply adding data: { turbo: false } does not seem to work.
<% will_paginate data: { turbo: false } %>
Copyright © 2021 Jogjafile Inc.
The reason why
<% will_paginate data: { turbo: false } %>does not work is that it puts thedata-turboattribute on the outer container div and not on the individual button links.Although there is no shortcut to disable
turbolinksfor thewill_paginatepagination links yet (at least I couldn't find any), the desired result can be achieved by customising thewill_paginaterenderer as follows.First, create the Custom renderer:
config/initializers/custom_paginate_renderer.rb. Note thedata-turbo="false"attribute on thelitags. This will do the trick.Next, pass this as the renderer for
will_paginate:app/helpers/application_helper.rb.Lastly, do not forget to restart the server for the config changes to take effect.
If anybody else knows a better way to do it, I'd be glad to hear it!
References:
https://github.com/mislav/will_paginate/wiki/Link-renderer
custom will_paginate renderer