title: rails 4 -- flash notice
body: <p>I'm still working on my rails 4 demo site, and I'm seeing an odd thing. In the controller it has a line like this:</p>
  
  <pre><code>format.html { redirect_to @widget, notice: 'Widget was successfully created.' }
  </code></pre>
  
  <p>This renders a flash message in the redirected page, which is expected. However, the css class attached to the message div is <code>alert alert-notice</code> rather than a valid Bootstrap alert class, like <code>alert-info</code>.</p>
  
  <p>Where is the class being set for this flash, and how do I customize it?</p>
  
  <p>Also, if I'm deleting a record via ajax, is there a way to access the core flash container to display the message via js, or do I have to show / hide my own flash message div just for ajax requests?</p>
  
  <p>EDIT: my Michael Hartl inspired <code>layouts/application.html.erb</code>:</p>
  
  <pre><code>&lt;div class="container"&gt;
    &lt;% flash.each do |key, value| %&gt;
      &lt;div class="alert alert-&lt;%= key %&gt;"&gt;&lt;%= value %&gt;&lt;/div&gt;
    &lt;% end %&gt;
    &lt;%= yield %&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Thanks!</p>
  
  <p>EDIT 2: </p>
  
  <p>Perhaps I wasn't clear enough in my original question. I understand exactly how the class is being set in the flash object in this case. I am interested in learning how to use and customize the <code>notice:</code> in the <code>format.html</code> block. It seems there should be a way to pass a class via this notice? Or is this not a core Rails way of doing things?</p>