Functionally speaking, both seem like subroutines that generate HTML based on certain parameters.
Is the decision to use one or the other in a given circumstance purely aesthetic?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Helpers and partials are both intended to be used in your view layer. The difference is that helpers are primarily ruby code, intended to be used as a library of methods to call from your templates. Partials are .html.erb files containing partial templates that can be inserted into your main templates. So in short, logic should go into helpers and reusable html snippets (with minimal embedded logic) should be in partials. Hope this helps!