Created
April 30, 2019 19:47
-
-
Save webzorg/85aed33c41fca0b0aeed9b095eb944e6 to your computer and use it in GitHub Desktop.
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
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