I am encountering an issue with my Rails app where I have two Bootstrap navigation bars. The primary bar includes a dropdown for user actions like sign-out and user profile, but it is being overlapped by the secondary bar.
Additionally, when I decrease the size of the viewport, the secondary bar collapses as expected, but the actions from the primary bar do not appear in the collapsed menu. How can I address this problem?
This is a snippet of my navbar code:
<nav role="navigation" class="navbar navbar-fixed-top firstnavbar">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" rel="home" href="#" title="Sickbubble">
<%= link_to(image_tag("cropped-sickbubble-logo-beta-3"),root_path) %>
</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<% if user_signed_in? %>
<div class="dropdown">
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown"><%= image_tag current_user.profile_image %> <%= "#{current_user.name}" %>
<span class="caret"></span></button>
<ul class="dropdown-menu">
<li><a href="#">HTML</a></li>
<li><a href="#">CSS</a></li>
<li><%= link_to 'Log out', destroy_user_session_path, method: :delete %></li>
</ul>
</div>
<% else %>
<li><%= link_to 'Log In', new_user_session_path %></li>
<li><%= link_to 'Register', new_user_registration_path %></li>
<% end %>
</ul>
</div>
</div>
</nav>
<nav role="navigation" class="navbar navbar-default navbar-fixed-top secondnavbar">
<div class="container">
<button type="button" data-target="#navbarCollapse" data-toggle="collapse" class="navbar-toggle">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div id="navbarCollapse" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><%= link_to "Categories", root_path %></li>
<li><%= link_to "Businesses", businesses_path %></li>
<li><%= link_to "Near me", geolocation_path, "data-no-turbolink": true %></li>
</ul>
</div>
</div>
</nav>
Here is some custom CSS that may be relevant to the issue:
.firstnavbar {
background-color: #282828;
border-radius: 0px;
border: 0px;
min-height:53px;
color: #ffffff;
margin-bottom: 0px;
ul.nav.navbar-nav, li {
font-weight: 400;
a {
color: #FFFFFF;
background-color: #282828;
}
a:hover {
background-color: #EEEEEE;
color: #282828;
}
}
}
.secondnavbar
{
background-color: #FFFFFF;
top: 50px;
ul.nav.navbar-nav, li {
font-weight: 400;
a {
color: #282828;
background-color: #FFFFFF;
}
a:hover {
background-color: #EEEEEE;
}
}
}
Image showing overlap: https://i.sstatic.net/X8kOS.png
Image showing responsive menu bar not displaying logout option: https://i.sstatic.net/bPMf6.png