Rails: Bootstrap and dropdown not working

Viewed 8009

In my application.html.erb, I have the following:

<head>
  <title><%= title %></title>
  <%= stylesheet_link_tag "application", media: 'all' %>
  <%= javascript_include_tag "application" %>
  <%= javascript_include_tag "https://js.stripe.com/v1/", "application" %>
  <%= csrf_meta_tags %>
  <%= tag :meta, :name => "stripe-key", :content => STRIPE_PUBLIC_KEY %>
  <%= javascript_include_tag "http://twitter.github.com/bootstrap/assets/js/bootstrap-dropdown.js", "application" %>
  <%= render 'layouts/shim' %>
</head>

In my gemfile, I have the following:

gem 'twitter-bootstrap-rails'
gem 'bootstrap-datepicker-rails'

In my views\layouts_header.html.erb, I have:

  <li class="dropdown" id="admin_menu">
    <a class="dropdown-toggle" data-toggle="dropdown" data-target="#admin_menu">
      <%= ADMIN_TITLE %>
      <b class="caret"></b>
    </a>
    <ul class="dropdown-menu">
      <% Admin_menu.each do |menu_text, menu_action| %>
          <li><a href="<%= menu_action %>"><%= menu_text %></a></li>
      <% end %>
    </ul>
  </li>

Admin_menu is defined elsewhere as: Admin_menu = Hash.new Admin_menu["Papers"] = "/papers" Admin_menu["Tracks"] = "/tracks" Admin_menu["Attendance"] = "/attendance"

When I click on the caret, nothing happens. I checked the HTML code, and the dropdown menu selections are there.

Any ideas?

2 Answers
Related