Bummer! This is just a preview. You need to be signed in with a Pro account to view the entire video.
What are partials?0:41 with Jason Seifer
In Rails, a partial is a piece of a view template. It will contain a small portion of markup and can be logically separated from other view templates.
In rails, a partial is a piece of a view template.
It will contain a small portion of markup, and
can be logically separated from other view templates.
The file name of a partial is prefixed with an underscore.
You've already seen this before with forms in the case of _form.html.erb.
We're not limited to just forms, though, and we can create our own partials
depending on the circumstances and requirements of our application.
In our case, we're going to extract the header into a partial for
being logged in and logged out of the application.
You need to sign up for Treehouse in order to download course files.Sign up