Our application layout is located at app/views/layouts/application.html.erb. This is used application wide, which means that every page of the app will have the same look and feel. Now, we'll need to change it so that our application uses the Bootstrap styles.
Open your app/views/layouts/application.html.erb file in your text editor and delete all the contents of the file.
Copy all of this code and paste it into the file:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><%= content_for?(:title) ? yield(:title) : "Rails Bootstrap" %></title>
<meta name="description" content="<%= content_for?(:description) ? yield(:description) : "Suggestotron" %>">
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
</head>
<body>
<header class="navbar navbar-fixed-top">
<nav class="navbar-inner">
<h4>Suggestotron</h4>
</header>
<main role="main">
<div class="container">
<div class="content">
<div class="row">
<div class="span12">
<% flash.each do |name, msg| %>
<% if msg.is_a?(String) %>
<div class="alert alert-<%= name == :notice ? "success" : "error" %>">
<a class="close" data-dismiss="alert">×</a>
<%= content_tag :div, msg, :id => "flash_#{name}" %>
</div>
<% end %>
<% end %>
<%= yield %>
</div>
</div>
</div>
</div>
</main>
</body>
</html>
Save the file. Now, you can view your app in the browser, test it out and you'll easily notice the changes in the look.
Also, if you are interested in learning more about HTML, CSS and JavaScript you can check out the FrontEnd Course.