I have some code that I need to access both inside my models as well as inside my views. How can I make a helper method available in both locations?
(While recognizing that this is generally an antipattern, I have a specific need. The DB stores some special strings for referencing a specific entry across tables. This string may appear both in prose—where I want to convert it into a real model reference in a helper called from the view—as well as in special table lookups—where I need to resolve it in the model.)
1 Answer