Better way to include helpers into application controller/te

Right now, I have the following in my application controller - and a
simliar version is duplicated in test_helper. There must be a better
way to include common functionality like this that gets used across
layers? Maybe at the very least a way to include it at the class
level and instance level with one line?

provide access to text helper at class level

def self.text_helper
Helper.instance
end

instance level

def text_helper
Helper.instance
end

include text_helper as singleton

class Helper
include Singleton
include ActionView::Helpers::TextHelper
end

  • Rob


http://www.robsanheim.com
http://www.seekingalpha.com
http://www.ajaxian.com

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs