1

I'm passing alerts to my views and in the layouts/application.html.erb file, I have this code:

<% flash.each do |type, message| %>
    <%= content_tag(:div, class: "alert alert-#{type}") do%>
        <button type="button" class="close" data-dismiss="alert">&times;</button>
        <%= message %>
    <% end %>
<% end %>

The alert is successfully working; however, the dismiss button (x all the way on the right side of the alert) isn't working.

Any ideas? Many others who experienced this problem seem to have forgotten to import bootstrap.

LewlSauce
  • 5,326
  • 8
  • 44
  • 91
  • try this http://stackoverflow.com/questions/13511833/alert-dismissing-using-twitter-bootstrap-is-not-working – Rahul Dess Oct 12 '14 at 20:39
  • I've ran across that before coming here. I've tried adding that and that didn't do anything. An error got generated saying that the file doesn't exist (I expected this). Any other thoughts? – LewlSauce Oct 12 '14 at 20:48

1 Answers1

2

Added "//= require bootstrap" to my assets/javascripts/application.js file and this solved my problem.

LewlSauce
  • 5,326
  • 8
  • 44
  • 91