Views and Adding Styles

All our views are located in the “views” folder. In here, we also have a layout file — layout.erb — which all views inherit their structure from. It is similar to the layout file in Rails.

html

# views/layout.erb <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta http-equiv="X-UA-Compatible" content="ie=edge" /> <title>Cost of living calc app</title> <link rel="stylesheet" href="css/bulma.min.css" type="text/css" rel="stylesheet" /> <link rel="stylesheet" href="css/style.css" rel="stylesheet" /> </head> <body> <!-- navbar partial --> <%= erb :'navbar' %> <!-- //navbar --> <div><%= yield %></div> </body> </html>

We also add a local copy of Bulma CSS and a custom stylesheet in public/css to provide styling for our app.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *