How to call methods defined in ApplicationController in models

六眼飞鱼酱① 提交于 2019-12-01 03:06:11
Boris Strandjev

Why would you need such thing? The model should not know about its controllers. Maybe a redesign of your system will be more appropriate in this case.

Here is a link to similar thread.

As a design choice, its not recommended to call controller helpers from your models.

You can just simply pass the required details to your model methods as arguments.


def transfer(active_gateway)
  active = active_gateway
end
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!