title: The use of :alert (or :notice) with the render method, from the Ruby On Rails guide called 'Layouts and Rendering in Rails', does not work for me:
body: <p>The use of :alert (or :notice) with the render method, from the Ruby On Rails guide called 'Layouts and Rendering in Rails' at <a href="http://guides.rubyonrails.org/layouts_and_rendering.html">http://guides.rubyonrails.org/layouts_and_rendering.html</a>, does not work for me</p>
  
  <p>That's the sample code provided in the guide:</p>
  
  <pre><code>    def index
        @books = Book.all
      end
  
      def show
        @book = Book.find_by_id(params[:id])
        if @book.nil?
          @books = Book.all
          render "index", :alert =&gt; 'Your book was not found!'
        end
      end
  </code></pre>
  
  <p>I have a hello controller that looks like this:</p>
  
  <pre><code>    class HelloController &lt; ApplicationController
        def index
          @counter = 5
        end
        def bye
          @counter = 4
          render "index", :alert =&gt; 'Alert message!'
        end
      end
  </code></pre>
  
  <p>My index.html.erb view looks like that:</p>
  
  <pre><code>    &lt;ul&gt;
      &lt;% @counter.times do |i| %&gt;
        &lt;li&gt;&lt;%= i %&gt;&lt;/li&gt;
      &lt;% end %&gt;
      &lt;/ul&gt;
  </code></pre>
  
  <p>When accessing <code>http://localhost:3000/hello/bye</code>, I see the index view, i.e. a list of numbers from 1 to 4 as expected, but there's no 'Alert message!' alert showing.</p>
  
  <p>My layout uses this to show alert messages:</p>
  
  <pre><code>    &lt;% flash.each do |k, v| %&gt;
        &lt;div id="&lt;%= k %&gt;"&gt;&lt;%= v %&gt;&lt;/div&gt;
      &lt;% end %&gt;
  </code></pre>