Ruby on Rails
Friday, February 7, 2020
I'm trying to right align a <ul> in my navbar but it doesn't right align, it's left aligned
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<% blog_logo=@blog.pictures.where('designation=?', 'blog_logo').first %>
<img src="<%= blog_logo.name %>" height=100 class="navbar-brand logo"><%= @blog.title %>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class = "nav navbar-nav navbar-right">
<% if user_signed_in? %>
<li class="nav-item dropdown">
<a href = "#" class = "dropdown-toggle" data-toggle = "dropdown">
<%= current_user.name %>
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<%= link_to (t 'main_site'), "http://www.#{request.domain}" %>
<%= link_to (t 'sign_out'), destroy_user_session_path, method: :delete %>
</div>
</li>
<li class="nav-item">
</li>
<% else %>
<li class="nav-item">
<%= link_to (t 'sign_in'), new_user_session_path %>
</li>
<% end %>
<% if admin_signed_in? %>
<li><%= link_to current_admin.name, administration_path, class: "nav-item" %>
<% end %>
</ul>
</div>
</nav>
<% blog_logo=@blog.pictures.where('designation=?', 'blog_logo').first %>
<img src="<%= blog_logo.name %>" height=100 class="navbar-brand logo"><%= @blog.title %>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class = "nav navbar-nav navbar-right">
<% if user_signed_in? %>
<li class="nav-item dropdown">
<a href = "#" class = "dropdown-toggle" data-toggle = "dropdown">
<%= current_user.name %>
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<%= link_to (t 'main_site'), "http://www.#{request.domain}" %>
<%= link_to (t 'sign_out'), destroy_user_session_path, method: :delete %>
</div>
</li>
<li class="nav-item">
</li>
<% else %>
<li class="nav-item">
<%= link_to (t 'sign_in'), new_user_session_path %>
</li>
<% end %>
<% if admin_signed_in? %>
<li><%= link_to current_admin.name, administration_path, class: "nav-item" %>
<% end %>
</ul>
</div>
</nav>
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/1c51c5c3-e928-479e-ae86-37ad10ae14aa%40googlegroups.com.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment