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.
Is there a convention around this? which is the ‘rails way’ of using them?
Thanks!
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.
I guess my rule of thumb is to use a helper to build a single ‘unit’ of display — like a span containing a link — and to use a partial to build a more complex unit of display composed of more than one ‘unit’ of display — like a grid or a menu.