This uses the Rails asset pipeline to load the Turf.js javascript library (http://turfjs.org/). Currently loads version 5.1.6 of Turf.js.
Add this line to your application's Gemfile:
gem 'turf-rails'And then execute:
$ bundle
Or install it yourself as:
$ gem install turf-rails
In assets/javascript/application.js, include the javascript file:
// = require turf
Bug reports and pull requests are welcome on GitHub at https://github.com/sanborn/turf-rails.
The gem is available as open source under the terms of the MIT License.