A ruby gem that uses the Rails asset pipeline to include the jQuery Slick plugin by Ken Wheeler (https://kenwheeler.github.io/slick/).
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install jquery-slick-rails
NOTE: this is a jQuery plugin so you will also need the
jquery-rails gem (it is not added by default starting from Rails 5.1):
You will need to add this line into your
//= require jquery.slick
/* *= require slick */
Starting from version 1.4.0 Slick provides an optional theme, so if you want to employ default styling, include
the following line into
/* *= require slick-theme */
You may use this simple Rails app as an example (it also shows how to use the plugin with Turbolinks).
If you are using Slick with Turbolinks, you might run into some problems with the browser's "back" button. If that happens, the following solution might help. Add this code to your layouts/application.html.erb:
<head> <% if content_for?(:head) %> <%= yield(:head) %> <% end %> </head>
And then on any page that has Slick:
<% content_for :head do %> <meta name="turbolinks-cache-control" content="no-cache"> <% end %>
Another solution was to employ the
unslick method to prepare your document before Turbolinks caches it:
However, this does not seem to work anymore - maybe because Slick has lots of opened issues related to unslick.
Read more on StackOverflow.
$ bundle install
$ rake test
git checkout -b my-new-feature)
git commit -am 'Added some feature')
git push origin my-new-feature)
This plugin is licensed under the MIT License.
Copyright (c) 2017 Ilya Bodrov