Created
March 6, 2010 00:03
-
-
Save tomdunning/323315 to your computer and use it in GitHub Desktop.
Growl for rails helper method. Growl flash[:notice] or flash[:error] in rails
This file contains 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 flash[:notice] %> | |
<%= growl_a_flash("Thanks", flash[:notice]) %> | |
<% end %> | |
<% if flash[:error] %> | |
<%= growl_a_flash("Error", flash[:error]) %> | |
<% end %> |
This file contains 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
def growl_a_flash(title,message) | |
return "<script type='text/javascript' language='javascript'> | |
Growl4Rails.showGrowl({ image_path:'/images/growl_icon.jpg', title:'" + title +"', message:'" + message + "'}); | |
</script>" | |
end |
This file contains 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
def create | |
#blah blah... | |
flash[:notice] ="create successful" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment