Css 在Rails应用程序中单击“x”时引导警报不会解除
单击Css 在Rails应用程序中单击“x”时引导警报不会解除,css,ruby-on-rails,twitter-bootstrap,Css,Ruby On Rails,Twitter Bootstrap,单击x时,通知不会消失 我不认为有任何缺少必需的css类,所以我不确定为什么这不起作用 单击x之前: 单击x后: application.html.erb <html> <body> ... <% if flash[:notice] %> <div class="alert alert-success alert-dismissible fade out in"> <button t
x
时,通知不会消失
我不认为有任何缺少必需的css类,所以我不确定为什么这不起作用
单击x
之前:
单击x
后:
application.html.erb
<html>
<body>
...
<% if flash[:notice] %>
<div class="alert alert-success alert-dismissible fade out in">
<button type="button" class="close" data-dismiss="alert">
<span>×</span>
</button>
<%= flash[:notice] %>
</div>
<% elsif flash[:error] %>
<div class="alert alert-danger alert-dismissible fade out in">
<button class="close" data-dismiss="alert">×</button>
<% flash[:error].each do |msg| %>
<li>
<%= msg %>
</li>
<% end %>
</div>
<% elsif flash[:alert] %>
<div class="alert alert-warning alert-dismissible fade out in">
<button type="button" class="close" data-dismiss="alert">×</button>
<%= flash[:alert] %>
</div>
<% end %>
</body>
</html>
gem 'bootstrap-sass'
应用程序.scss
@import 'bootstrap-sprockets';
@import 'bootstrap';
还有什么可以推荐我试试的吗?解决方案。 向application.js添加
/=require bootstrap链轮
我不知道除了@import'bootstrap链轮',还需要这个
在application.scss
中,您是否正确加载了用于引导的javascript?