This gem changes user's input through typography rules of http://typograf.ru. It is designed for ActiveRecord.
Just add the following line to your Gemfile as usual.
gem 'typograf_ru'
and install it
$ bundle install
class Post < ActiveRecord::Base
typografy :content
end
It will format the content before save.
The typografy
method supports two options:
:if
expects aProc
returningtrue
orfalse
.:no_check
if true it will always hit the service before save.
You can disable the gem in tests:
describe Post do
before { Post.disable_typografy! }
# ...
end