now I may get corrected or put down for this, but I have put some
constants into my models where I wanted to have them available for
mapping view information against model attributes.
If you want some constants available globally (something I have been
thinking about myself), but don't view them as being Environment type
variables, then could you not create a model Class to contain the
models and then reference them by that class. That would seem to me
to be a fairly clean approach, but someone may say that this goes
against the 'rules'? I would be interested to know.
In the application controller you could put this line of code:
'include ApplicationHelper' in order to be able to use the helper
methods in the controller. Another approach is to put your code in
the /lib folder and do a require 'filename' in the controller or
model.
I'd suggest not just wholesale-including ApplicationHelper into
ApplicationController. Any public methods in controllers in Rails end
up being exposed as actions, which may have inadvertent side effects,
unless you call hide_action on them, and it's generally better
practice to separate view and controller.