Home Rails4: ActivityNotification
Reply: 0

Rails4: ActivityNotification

user1302
1#
user1302 Published in May 22, 2018, 11:45 am

I'm using ActivityNotification gem to get notifications to user. I'm also using acts_as_follower gem to make users follow each other. O implement the code as the documentation to notificate users when someone follow them, but the notifications dont coming.

The name of my devise user model is User

My code on model is:

follow.rb

# acts_as_notifiable configures your model as ActivityNotification::Notifiable
  # with parameters as value or custom methods defined in your model as lambda or symbol.
  # The first argument is the plural symbol name of your target model.
  acts_as_notifiable :users,
  # Notification targets as :targets is a necessary option
  # Set to notify to author and users commented to the article, except comment owner self
  targets: ->(follow, key) {
    ([follow.user] + follow.user.to_a - [follow.user]).uniq
  },
  # Path to move when the notification is opened by the target user
  # This is an optional configuration since activity_notification uses polymorphic_path as default

Someone already work with this gem before?

I'm getting no notification when I render

<%= render_notifications_of current_user, index_content: :with_attributes %>
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.626191 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO