I use Gritter notifications in Rails 5 app and can't find a way to remove default title of the notification popup. I add Gritter as bellow:
<%= js add_gritter(flash[:notice], title: 'I dont need you', sticky: false) %>
Tried:
<%= js add_gritter(flash[:notice], title: false, sticky: false) %>
<%= js add_gritter(flash[:notice], title: nil, sticky: false) %>
<%= js add_gritter(flash[:notice], title: '', sticky: false) %>
<%= js add_gritter(flash[:notice], title: ' ', sticky: false) %>
And still popup appears with the default title - "Notification". Tried to search in the whole app's project "Notification" or "gritter", but nothing related was found.
How to get rid of it?
The
add_grittermethod in the gem sets theoptions[:title]as "Notification" ifoptions[:title].blank?returns true.The "dirty" option is to define it again, with a hash of options instead
*args, and to render the title if it was passed as an option argument, like:But the gritter.js file has an
ifto check if thetitlehas any content, so you should have to deal with your own and edit it, just to check for the text, like: