For the ruby on rails guide, need help on understanding how the render works for partial -


I'm going through Ruby on Rail guide, but I saw something that I do not understand. In that section where you teach how to present a partial form for the comment section of the blog. For partial comments, he wrote

& lt; H2 & gt; Comments & lt; / H2 & gt;

But for the form they were used

  & lt; H2 & gt; H2 & gt; & Lt;% = Render "Comments / Form"% & gt;   

Why is it that the first one was used and "/ comments" were not submitted

The difference here is, table entry from @ article.comments a @article , even then comments / form < / code> will be the file html.erb in the comments folder in _form.html.erb .

You can find different uses of render on the Rabin's page page.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -