Getting wice_grid to work with Rails

Step 1

Add the gem to Gemfile:

gem 'wice_grid'

Run bundle install.

Step 2

Add the require statement in application.js:

//= require jquery3
//= require jquery_ujs
//= require jquery-ui
//= require popper
//= require wice_grid
//= require bootstrap
//= require turbolinks
//= require_tree .

Step 3

In application.scss add the import statement for wice_grid.

@import 'bootstrap';
@import "wice_grid";
@import "font-awesome-sprockets";
@import "font-awesome";

Step 4

You must initialize wice_grid to get sort, search and reset to work. Make sure it is initialized after Turbolinks is loaded on the page.

<script type='text/javascript'>
  $(document).on('turbolinks:load', function() {
    initWiceGrid();
  });
</script>

Add this to the application layout file just before the body tag closes.


Related Articles


Ace the Technical Interview

  • Easily find the gaps in your knowledge
  • Get customized lessons based on where you are
  • Take consistent action everyday
  • Builtin accountability to keep you on track
  • You will solve bigger problems over time
  • Get the job of your dreams

Take the 30 Day Coding Skills Challenge

Gain confidence to attend the interview

No spam ever. Unsubscribe anytime.