When to use Helpers vs Model

后端 未结 3 895
醉话见心
醉话见心 2020-12-14 16:02

I\'m new to Rails and just wondering when I should put code into a Helper as opposed to putting the code into the Model.

Is there a \'rule of thumb\' so to speak for

3条回答
  •  余生分开走
    2020-12-14 16:14

    Helpers should only contain logic for the view

    Models should contain only logic related to the object modeled, never related with the transaction performed neither the view rendered

提交回复
热议问题