Introducing rambling-slider-rails: Easily include the jQuery Rambling Slider on your rails app
April 27, 2012
This post was originally published in the Rambling Labs Blog on April 27, 2012.
About three weeks ago, I had to use the jQuery Rambling Slider together with the Rails asset pipeline… It was a headache and a total mess… Having to change all the references to the images on the CSS file, as well as the themes was not as smooth as I would like that to be.
So, I automated the process a bit locally and started to think how would be the easiest way to integrate the jQuery Rambling Slider into a Rails app. Then it hit me…
Of course! How about building a gem that includes the necessary adjustments for the asset pipeline on Rails? That would we really cool and will save me from doing the same process over and over again for each new application in which I want to use it.
That’s how the
rambling-slider-rails gem was born. It offers a simple way to include the slider on your Rails app, without much cluttering. You can see the project on GitHub, currently on version 0.0.1.
So, to include it in your application, just add this to your Gemfile:
Also, be sure to have at least these two lines on your
//= require jquery //= require jquery.rambling.slider
And this line on your
/* *= require jquery.rambling.slider */
That’s it! You should be able to initialize the jQuery Rambling Slider wherever you need to now!