views:

27

answers:

1

I know that "helpers" are usually for views/templates. But say I have a helper method that I want to call from different controllers. Where should this file go?

I was thinking of creating a helper module in the "models" folder but I'd like to know if there's a "correct" way to do this.

+2  A: 

Any method you put in ApplicationController will be inherited by your other controllers (as long as it's not private of course).

Skilldrick
On a related note, what if I want to organize the code a little? And instead of just throwing it into the ApplicationController I want to put it in a module called "DateHelpers".
MakeM
@MakeM - why not `include` the module in `ApplicationController`?
Skilldrick
Ok, I could do that but where do I put the file? Should it go in the 'models' folder? Btw, thanks so much for the answers so far.
MakeM
@MakeM, I usually put them in app/controllers/mixins
Jason stewart
I put them in `lib`
Matt