So I’m using an application.html.erb file which is basically the layout for every page in my website. But I want the homepage to have a white background and the rest of the pages to have a different background. The problem is, if I wrap the entire homepage file in a div, it only wraps the “yield” place and so it shows as a box with a white background within a larger box with a gray background. So how can I change the entire background of the homepage and leave the rest?
Thanks!
Expanding on the answer provided by @muffinista:
You can use an instance variable set in the controller to determine when to put the ‘homepage’ class on the body tag. So:
and in the layout: