When to use Helpers instead of Partials

后端 未结 6 367
不知归路
不知归路 2020-12-05 13:03

In a rails application, in which situation would you use a partial and when would you use a helper? I find both very similar, since they represent markup fragments.

6条回答
  •  一个人的身影
    2020-12-05 13:18

    I use helpers when the code is likely to be used again in other projects, and partials for code specific to the project.

提交回复
热议问题