Skip to content

Instantly share code, notes, and snippets.

@webzorg
Created April 30, 2019 19:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save webzorg/85aed33c41fca0b0aeed9b095eb944e6 to your computer and use it in GitHub Desktop.
Save webzorg/85aed33c41fca0b0aeed9b095eb944e6 to your computer and use it in GitHub Desktop.
module ApplicationHelper
def bell_notification_with_conditional_counter
if Notification.unread_count(current_user).zero?
icon("fas", "bell", class: "notification-bell")
else
icon("fas", "bell", class: "notification-bell", data: { count: Notification.unread_count(current_user) })
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment