Bliss.js for Rails
This gem wraps the Bliss.js library written by Lea Verou and makes it available to the Rails Asset Pipeline.
Installation
Add the gem to the Gemfile
in your Rails project:
ruby
gem 'blissful-rails'
Then execute:
sh
$ bundle install
And add your favourite flavour to your application.js
file:
javascript
//= require bliss
If you want to go with the shy version (it doesn’t touch the host environment,
except by adding a global variable named Bliss
), you might do want to add
this instead:
javascript
//= require bliss.shy
You might also be interested in the blissful-ujs
gem if you are looking to
replace jquery-ujs
. Read more about it
here.
Usage
If you installed this library, then you might want to visit the documentation. Basically, I might give you a tip:
```javascript
$.ready().then(function () { console.log(‘Ok, you've loaded Bliss.js successfully!’) })
```
Blissful documentation mentions which jQuery methods are similar. The difference between those is the implementation: Bliss is only 3kb and might probably not work well in older browsers without polyfills.
See this if you have issues.
Development
This gem is updated once a week. Basically, if we find changes in the JavaScript library, we will put the new JavaScript files and upload a new gem. However, the library was written for little to no maintenance, hence even if you do not see activity in a month or so, it’s safe to use.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/spicymagpie/blissful-rails.
License
The gem is available as open source under the terms of the MIT License.
Thanks
Thanks to Lea Verou for writing the library, and to Hendrik Kleinwächter for letting me experiment a little with other things.