Iteration C2: Adding a Page Layout
The pages in a typical website often share a similar layout; the designer will have created a standard template that’s used when content is placed. Our job is to modify this page to add decoration to each of the store pages.
If you look at the html.erb files we’ve created so far, you won’t find any reference to style sheets. You won’t even find the HTML <head> section where such references would normally live. Instead, Rails keeps a separate file that’s used to create a standard page environment for the entire application. This file, called application.html.erb, is a Rails layout and lives in the layouts directory: we can change the look and feel of the entire site by editing this one file. This makes us ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access