Skip to content

Instantly share code, notes, and snippets.

@tomdunning
Created March 6, 2010 00:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomdunning/323315 to your computer and use it in GitHub Desktop.
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
<% if flash[:notice] %>
<%= growl_a_flash("Thanks", flash[:notice]) %>
<% end %>
<% if flash[:error] %>
<%= growl_a_flash("Error", flash[:error]) %>
<% end %>
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
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