在我的 application.html.erb 中,我有以下内容:
<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>
在我的 gemfile 中,我有以下内容:
gem 'twitter-bootstrap-rails'
gem 'bootstrap-datepicker-rails'
在我的意见\layouts_header.html.erb 中,我有:
<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 在别处定义为: Admin_menu = Hash.new Admin_menu["Papers"] = "/papers" Admin_menu["Tracks"] = "/tracks" Admin_menu["Attendance"] = "/attendance"
当我单击插入符号时,没有任何反应。我检查了 HTML 代码,那里有下拉菜单选项。
有任何想法吗?