开发者

Where should I put CONTROLLER helper methods?

开发者 https://www.devze.com 2023-01-19 19:57 出处:网络
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 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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号