Skip to content

Instantly share code, notes, and snippets.

@DevanB
Last active December 20, 2015 22:29
Show Gist options
  • Save DevanB/6204991 to your computer and use it in GitHub Desktop.
Save DevanB/6204991 to your computer and use it in GitHub Desktop.
Dropdown Support Anjlabs Bootstrap 3 gem
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*= require twitter/bootstrap
*= require_self
*= require bootstrap_form
*= require_tree .
*/
@import 'twitter/bootstrap';
@import 'anjlab/datepicker';
@import 'anjlab/timepicker';
/* header */
body {
padding-top: 70px;
}
.brand:hover {
color: black;
text-decoration: none;
}
.welcome {
float:none;
padding: 10px 15px 10px;
color: #777777;
text-decoration:none;
text-shadow: 0 1px 0 white;
}
<div class="navbar navbar-inverse navbar-fixed-top">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
<span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span>
</button>
<%= link_to image_tag("logo.png") + " Birmingham Events", root_path, class: "navbar-brand" %>
<div class="nav-collapse collapse navbar-responsive-collapse">
<ul class="nav navbar-nav pull-right dropdown">
<% if user_signed_in? %>
<li class="dropdown"><a data-toggle="dropdown" href="#">Settings</a>
<ul class="dropdown-menu">
<li><%= link_to "Account Settings", edit_user_registration_path %></li>
<li><%= link_to "Sign Out", destroy_user_session_path, :method => :delete %></li>
</ul><!-- end "dropdown-menu" -->
</li>
<% else %>
<li><%= link_to "Sign In", new_user_session_path %></li>
<% end %>
</ul><!-- end "nav" -->
</div><!-- end "nav-collapse" -->
</div><!-- end "navbar" -->
@yury
Copy link

yury commented Aug 12, 2013

take a look at slim version:

.navbar.navbar-inverse.navbar-fixed-top
  button.navbar-toggle type="button" data-toggle="collapse" data-target=".navbar-responsive-collapse"
    span.icon-bar
    span.icon-bar
    span.icon-bar
  = link_to root_path, class: "navbar-brand" do
    = image_tag("logo.png")
    '  Birmingham Events
  .nav-collapse.collapse.navbar-responsive-collapse
    ul.nav.navbar-nav.pull-right.dropdown
      - if user_signed_in?
        li.dropdown
          a data-toggle="dropdown" href="#" Settings
          ul.dropdown-menu
            li
              = link_to "Account Settings", edit_user_registration_path
            li
              = link_to "Sign Out", destroy_user_session_path, :method => :delete
      - else
        li
          = link_to "Sign In", new_user_session_path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment