Recent Activities in Ruby on Rails

后端 未结 2 1181
傲寒
傲寒 2021-01-31 23:46

What is the best way to implement a StackOverflow-style Recent Activities page?

I have a Gallery with user\'s photos and I want them to be notified when other

2条回答
  •  广开言路
    2021-02-01 00:38

    This has been written up into a great article which shows the full use of AR, Observers and gives the migration you will need.

    http://mickeyben.com/blog/2010/05/23/creating-an-activity-feed-with-rails/

    Observers save you cluttering your models with this information so as well as adding activities you can send emails or whatever else you need to do.

提交回复
热议问题