Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Build a Simple Ruby on Rails Application Designing URLs The Flash Message

William Bode
William Bode
7,105 Points

Bootstrap Syntax not working as shown in Video, this code works:

<% if flash[:notice] %>
   <div class="alert alert-info">
  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<%= notice %>
</div>
  <% end %> 
  <% if flash[:alert] %>
    <div class="alert alert-warning">
  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<%= alert %>
</div>
  <% end %> 

Have a good one everybody!

1 Answer

Juan Ordaz
Juan Ordaz
12,012 Points
        <div class = "container">
            <% if flash[ :notice ] %>
                <div class ="alert alert-success alert-dismissible" role="alert">
                    <button type = "button" class = "close" data-dismiss="alert" arial-label="Close">
                        <span arial-hidden="true">&times;</span>
                    </button>
                    <%= flash[ :notice ] %>
                </div>
            <% end %>

            <% if flash[ :alert ] %>
                <div class ="alert alert-danger alert-dismissible" role="alert">
                    <button type = "button" class = "close" data-dismiss="alert" arial-label="Close">
                        <span arial-hidden="true">&times;</span>
                    </button>
                    <%= flash[ :alert ] %>
                </div>
            <% end %>

            <%= yield %>
        </div>

This is the most recent answer, this video is out-of-date, but is ok! Always practice making your own research, practice debugging, and learn how to read documentation . It has helped me greatly. Remember struggle == success