What’s the diference between:
<% content_for :something do %>
and
<% provide :something do %>
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.
#provide works in almost the same manner as #content_for, save that
#providedoes not concatenate blocks. That is–and the following code is cribbed from the documentation–say you have these#content_fors, possibly in multiple templates but defined in this order:Now, the following will render both navigation items in an un-ordered list, ‘Home’ first then ‘Login’:
#providewill not concatenate and would have rendered a list with but one element.