Skip to content

mdorfin/typograf_ru

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

typograf_ru

This gem changes user's input through typography rules of http://typograf.ru. It is designed for ActiveRecord.

Installation

Just add the following line to your Gemfile as usual.

  gem 'typograf_ru'

and install it

  $ bundle install

Ussage

  class Post < ActiveRecord::Base
    typografy :content
  end 

It will format the content before save.

The typografy method supports two options:

  • :if expects a Proc returning true or false.
  • :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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages