On Mon, Mar 1, 2010 at 7:07 AM, GoodGets [email protected] wrote:
I’m changing how rails handles error messages. So I’m defining
ActionView::Base.field_error_proc = Proc.new do
Where should I put this? I’ve seen examples putting it in the
application_controller, as well as creating a new initializer. Both
ways work (at least for me in this case), but which is best? and why?
Some people associate the fact that ApplicationController is needed to
serve a request with a place to put required global stuff like that.
Reason is that they observe the framework loads that file necessarily.
(Note that a background job may not trigger any request though.)
That is not the role of ApplicationController. That is a class that
should be used according to its OO role: it is the root of the
In my opinion global stuff like the one you mention belongs to the