app/helpers/application_helper.rb
module ApplicationHelper
# for nice notifications with toastr
def custom_bootstrap_flash
flash_messages = []
flash.each do |type, message|
type = 'success' if type == 'notice'
type = 'error' if type == 'alert'
puts type
text = "<script>toastr.#{type}('#{message}');</script>"
flash_messages << text.html_safe if message
end
flash_messages.join("\n").html_safe
end
end