Skip to content

Instantly share code, notes, and snippets.

@robotmay
Created February 8, 2013 15:23
Show Gist options
  • Save robotmay/4739676 to your computer and use it in GitHub Desktop.
Save robotmay/4739676 to your computer and use it in GitHub Desktop.
Example of how to hide flash messages
...
def create
flash[:alert] = "You created a thing!"
redirect_to "/somepath"
end
...
...
<div id="flash-messages">
<% flash.each do |type, message| %>
<div class="<%= type %>">
<%= message %>
</div>
<% end %>
</div>
...
$(document).ready(function() {
$("#flash-messages div").delay(5000).slideUp();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment