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

instance level

def text_helper

include text_helper as singleton

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

  • Rob

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