Where to put reusable methods for access by controllers in rails
Posted
by 99miles
on Stack Overflow
See other posts from Stack Overflow
or by 99miles
Published on 2010-04-28T05:01:33Z
Indexed on
2010/04/28
5:03 UTC
Read the original article
Hit count: 495
I have several methods I call from my controllers that feel like they should be pulled out and put into a reusable class, outside of the controller. Where do people usually put this stuff? I know I can put them into my ApplicationController, but that doesn't seem to be a great solution if I think I can use these methods later in other applications.
Also, I have a bunch of utility methods in my controllers that likely won't be used in other controllers, or in the future at all, but I feel like they just bloat my controller a bit. Do people usually move these out someplace for cleanliness or just end up with a huge controller?
I'm coming from Java and Actionscript where I'd just create new util classes for this stuff.
© Stack Overflow or respective owner