[color=red][quote]The Rails Concern are used to DRYING the code for both models and controllers.So just by including the module,either in model/controller you get the methods and you can call them just like you call it usually as if they are defined within the controller/model.[/quote][/color]
[url]http://stackoverflow.com/questions/14541823/how-to-use-concerns-in-rails-4[/url]
[url]http://stackoverflow.com/questions/14541823/how-to-use-concerns-in-rails-4[/url]
本文深入探讨了Rails Concerns如何用于在模型和控制器中实现代码的复用,通过模块的包含,可以在不需要重新定义方法的情况下在模型或控制器中调用它们,从而提高代码的可读性和维护性。
494

被折叠的 条评论
为什么被折叠?



