For a similar question, refer to this link. This particular question is distinct in that it focuses on implementing a conditional statement to remove a section of the layout instead of the entire file.
I attempted:
if current_page?(root_path)
# your html
end
Below is the updated version of application.html.erb:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="author" content="">
<!--Google Fonts-->
<link href="https://fonts.googleapis.com/css?family=Quicksand|Raleway:600" rel="stylesheet">
<%= stylesheet_link_tag 'application', media: 'all' %>
<%= javascript_include_tag 'application' %
<%= csrf_meta_tags %>
</head>
<body>
<!--Navbar/Footer-->
<% if current_page?(root_path) %>
#NAVBAR
#FOOTER
<% end %>**
<!--Javascript-->
<script>
$(document).ready(function(){
$('[data-toggle="tooltip"]').tooltip();
});
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"> </script>
</body>
</html>
Updated version of application.html.erb:
<% if current_page?(root_path) %>
<body>
<div class="container">
<div class="content">
<%= yield %>
</div>
</div>
</body>
<% else %>
<body>
<!--Header-->
<%= render 'shared/header' %>
<!--Content-->
<div class="container">
<div class="content">
<%= yield %>
</div>
</div>
<!--Footer-->
<%= render 'shared/footer' %>
</body>
<% end %>
To include the navbar, modify app/views/shared/header.html.erb
To add the footer, update app/views/shared/footer.html.erb