Skip to content

Instantly share code, notes, and snippets.

@cheesepaulo
Created June 25, 2019 13:47
Show Gist options
  • Save cheesepaulo/aabe278758669c89fe5ead1d56716cde to your computer and use it in GitHub Desktop.
Save cheesepaulo/aabe278758669c89fe5ead1d56716cde to your computer and use it in GitHub Desktop.
<% flash.each do |type, message| %>
<% if type == 'success' || type == 'notice' %>
<script type="text/javascript">
$(function(){
PNotify.success({
text: "<%= message %>",
delay: 3000,
styling: 'bootstrap4'
});
});
</script>
<% else %>
<script type="text/javascript">
$(function(){
PNotify.<%= type %>({
text: "<%= message %>",
delay: 3000,
styling: 'bootstrap4'
});
});
</script>
<% end %>
<% end %>
yarn add pnotify
** resto do teu arquivo** add essa linha
//= require pnotify/dist/umd/PNotify
@import "pnotify/dist/PNotifyBrightTheme";
@import "custom_pnotify";
.ui-pnotify {
margin-top: 50px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment