Skip to content

Instantly share code, notes, and snippets.

@timriley
Forked from chrislloyd/string.rb
Created February 26, 2009 02:18
Show Gist options
  • Save timriley/70594 to your computer and use it in GitHub Desktop.
Save timriley/70594 to your computer and use it in GitHub Desktop.
require 'singleton'
class String
class TextHelperSingleton
include Singleton
include ActionView::Helpers::TextHelper
end
def method_missing(method, *args)
if TextHelperSingleton.instance.respond_to?(method)
TextHelperSingleton.instance.send(method, self, *args)
else
super
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment