I have read it from the Rails guides, Have looked at Micheal Hartel book and now reading it from Rails View book but still I get confused :(
There is a _footer.html.erb
file so it is a "partial" and in the code it has written:
<%=render 'layouts/footer' %>
so my understanding is that when it sees this, goes and insert the HTML for footer file in here. Ok...
Now a few pages later it is saying:
<%= render partial: 'activitiy_items/recent' %>
so WHY this time we have the word "partial" in here but we didn't have it in the previous one?
And there somewhere else I see <%= yield :sidebar %>
So this yield
also insert HTML in its place? Well wasn't it what render
was doing?
I was hoping if another programmer instead of books explains this to me maybe I get it this time:)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…