-1

I have created a log model and a method in every controller to keep record of action performed in every controller. that method populate logs modle. But i don't know how keep record of user creation, deletion and update using this function.

The method that i have created is:-

def keep_record(msg)
    @log = Log.new
    @log.user_id = current_user.id
    @log.description = msg
    @log.save
end

How can i use this method to keep record of creating, editing and removing user in devise gem.

Can anyone suggest me how to modify Registration_controller to keep record of creating, deleting and updating user.

Shital luitel
  • 135
  • 15

1 Answers1

1

I'm not sure what you mean by "track the activities", but it sounds like you want to track when a user changes those attributes. I would suggest looking into ActionCable, which the user will make a connection with, and basically subscribe to a channel, and you can record what they are doing.

Here is a good place to start: Actioncable connected users list

Community
  • 1
  • 1
gwalshington
  • 1,418
  • 2
  • 30
  • 60