0

我在我的项目中使用Sass-Bootstrap gem,并在我的application.js文件中有以下内容。

// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
//= require jquery
//= require jquery_ujs
//= require bootstrap
//= require bootstrap-scrollspy
//= require bootstrap-modal
//= require bootstrap-dropdown 
//= require_tree 

我在我的application.html.erb文件中包含以下标记以利用模态功能。

<div class="modal" id="loginModal">
          <div class="modal-header">
            <button class="close" data-dismiss="modal">×</button>
            <h3>Sign in</h3>
          </div>
          <div class="modal-body">
            <%= simple_form_for(resource, :as => resource_name, :url => session_path(resource_name),:html => { :class => 'form-horizontal' }) do |f| %>
                    <%= f.input :email, :required => false, :autofocus => true %>
                    <%= f.input :password, :required => false %>
                    <%= f.input :remember_me, :as => :boolean if devise_mapping.rememberable? %>
                    <%= f.button :submit, "Sign in", :class => 'btn' %>
                <% end %>
          </div>
        </div>

但出于某种原因。即使在任何其他文件中都没有 javascript/coffescript 时,模态也会显示...调用它的是什么?这是默认行为吗?

4

1 回答 1

0

尝试:

<div class="modal hide" id="loginModal">
于 2012-05-22T20:47:34.460 回答