Skip to content

Instantly share code, notes, and snippets.

@havenwood
Forked from webzorg/application_helper.rb
Last active April 30, 2019 19:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save havenwood/8c5cb119fb6f28edf3478f2b91e21af9 to your computer and use it in GitHub Desktop.
Save havenwood/8c5cb119fb6f28edf3478f2b91e21af9 to your computer and use it in GitHub Desktop.
module ApplicationHelper
def bell_notification_with_conditional_counter
keyword_arguments = {class: 'notification-bell'}
keyword_arguments[:data] = {count: '...'} if Notification.unread_count(current_user).nonzero?
icon("fas", "bell", **keyword_arguments)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment