erpe/rails_will_paginate_seo_helper

Working with bootstrap-will_paginate

Closed this issue · 2 comments

Hi How are you, awesome little helper here, I was hoping you could help me I am running the below successfully

gem 'will_paginate'
gem 'bootstrap-will_paginate'

via

<%= will_paginate(@brand_products, :renderer => WillPaginate::ActionView::Bootstrap4LinkRenderer, class: 'pagination-sm') %>

when I add your gem file like so

gem 'will_paginate'
gem 'bootstrap-will_paginate'
gem 'rails_will_paginate_seo_helper'

and input the code

<% content_for :pagination_rel_links do %>
           <%= will_paginate_seo_links(@brand_products, :renderer => WillPaginate::ActionView::Bootstrap4LinkRenderer, class: 'pagination-sm') %>
         <% end %>  

I get the better error

wrong number of arguments (given 2, expected 1)

Am i missing something?

FYI my controller looks like so

@brand_products = @brand.products.paginate(page: params[:page], per_page: 16)

erpe commented

Oh - sorry - wasn't paying attention for a while.

the will_paginate_seo_links helper is an addition to create rel|pref tagged links in the header of your html-document.
the way you use will_paginate in the body of your page and with any renderer u like is not changed.
I'll update the README to make this better understandable...

erpe commented

Updated the readme, i hope this is sufficient to clearify ...