underscore.string for Rails.
underscore-string-rails
depends on underscore-rails.
So Add these lines to your application's Gemfile:
gem 'underscore-rails'
gem 'underscore-string-rails'
And then execute:
$ bundle
Or install it yourself as:
$ gem install underscore-rails underscore-string-rails
In your application.js
you will need to add these lines:
//= require underscore
//= require underscore.string
And mixin underscore.string
to underscore
after document is ready to make all exported underscore.string functions be accessible via '_'.
$(function() {
_.mixin s.exports()
}
Bug reports and pull requests are welcome on GitHub at https://github.com/inventit/underscore-string-rails.
The gem is available as open source under the terms of the MIT License.