I need a place to stick global referentially transparent utility methods. These should be accessible from everywhere in rails (Models, Views, Controllers, and everywhere else). e.g.:
bool = GlobalUtilities.to_bool "false"
unicorn = GlobalUtilities.make_me_a "unicorn"
What’s the best way to do this?
You could always stick these in
/liband require them. See bricker’s answer — you can require these modules to be loaded from yourapplication.rb, which will make them accessible everywhere.See: Rails lib directory