-
-
Save shivakumaarmgs/e2a9cc260a6284c046c89c25b80ef70b to your computer and use it in GitHub Desktop.
Rails flash messages in toastr.js
This file contains hidden or 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
| <% unless flash.empty? %> | |
| <script type="text/javascript"> | |
| <% flash.each do |f| %> | |
| <% type = f[0].gsub('alert', 'error').gsub('notice', 'info') %> | |
| toastr['<%= type %>']('<%= f[1] %>', '<%= type %>'); | |
| <% end %> | |
| </script> | |
| <% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment