Truncates
This Gem allows you to set a field to automatically be truncated to a specific length before validatioin.
Installation
Add this line to your application's Gemfile:
gem 'truncates'
And then execute:
$ bundle
Or install it yourself as:
$ gem install truncates
Usage
class Address < ActiveRecord::Base
truncates :city, max_length: 30, character_trail: "..."
end
Contributing
- Fork it ( https://github.com/[my-github-username]/truncates/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request