def custombootstrapflash
flashmessages = []
flash.each do |type, message|
type = :success if type == :notice
type = :error if type == :alert
text = "<script>toastr.#{type}('#{message}');</script>"
flashmessages << text.htmlsafe if message
end
flashmessages.join("\n").html_safe
end
-----> Will don't show any things.
If you want to use
You must put
def custombootstrapflash
flashmessages = []
flash.each do |type, message|
type = :success if type == :notice
type = :error if type == :alert
text = "<script>toastr.#{type}('#{message}');</script>"
flashmessages << text.htmlsafe if message
end
flashmessages.join("\n").html_safe
end
-----> Will don't show any things.
If you want to use
You must put
type = type.to_sym
before
type = 'success' if type == 'notice'