Ruby on Rails 5 Basics
I really don't understand what this is doing?
what is render template and what does layout signify
A template will be rendered automatically by rails that has the same name of the action.
render template: "posts/index.html.erb" is specifying which template to render, in this example they loaded the same that would have been rendered anyways.
layout: "application" is a default place you put HTML you want to be rendered on multiple pages. This prevents you from repeating the same HTML multiple places.
render template: "posts/index.html.erb"
Posting to the forum is only allowed for members with active accounts.
Please sign in or sign up to post.