Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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