Created
August 5, 2011 18:23
-
-
Save baldwindavid/1128167 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
$(".flash").livequery(function(){ | |
$(this).delay(5000).fadeThenSlideToggle(); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% if @item.valid? %> | |
jQuery("#some-element").prepend("<div class='flash notice'>Item created!</div>"); | |
<% else %> | |
jQuery("#some-element").prepend("<div class='flash error'><%= escape_javascript(render('shared/error_messages', :target => @item)) %></div>"); | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Well, I probably never would have noticed, but was just recently dealing with a #flash in a single place.