This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module ActionView | |
| module Helpers | |
| module TextHelper | |
| def simple_format_with_hyphenation(text, html_options={}) | |
| simple_format_without_hyphenation(text.gsub(/(\w{6})(\w)/,'\1­\2'), html_options) | |
| end | |
| alias_method_chain :simple_format, :hyphenation | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # drop in /lib in a rails app | |
| # replace MODEL with the model to run against | |
| # enable in environment.rb with: | |
| # config.middleware.use 'Shrtn::Middleware' | |
| module Shrtn | |
| class Helper | |
| include Singleton | |
| def initialize | |
| @chars = ('A'..'Z').to_a + ('a'..'z').to_a + ('0'..'9').to_a + ['-','_'] |
NewerOlder