Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

uninitialized constant ActionView::CompiledTemplates::BootstrapPagination

I have installed the will_paginate-bootstrap gem to use bootstrap style pagination. I have this in my view:

    <%= will_paginate @mylist, renderer: BootstrapPagination::Rails %> 

but it returns this error

    uninitialized constant ActionView::CompiledTemplates::BootstrapPagination
like image 991
Sayed Jalil Hassan Avatar asked Jan 10 '14 06:01

Sayed Jalil Hassan


2 Answers

If you have successfully bundle all the gems then it should work like this.

<%= will_paginate @mylist, :renderer => BootstrapPagination::Rails %>

Please make sure you have restarted the server after installing the gem.

like image 160
Sabyasachi Ghosh Avatar answered Nov 16 '22 17:11

Sabyasachi Ghosh


If you use gem will_paginate-bootstrap with rails 4.0 or later, you must have it available on all stages. See Rails Upgrade Guide 3.2 to 4.0. Before Rails 4.0 this was fine, to have it only in assets.

This is right for rails 3.X or earlier:

gem 'will_paginate-bootstrap', group: :assets

It must be outside of any groups (on rails 4.0 and later):

gem 'will_paginate-bootstrap'
like image 33
Fa11enAngel Avatar answered Nov 16 '22 17:11

Fa11enAngel