Forum: RForum tracking user forum visits?

Posted by Alex Ciarlillo (ac251404)
on 2007-08-29 17:49
I want to implement the ability to track when users visist forums. So if
I have two forums each time the user visits them a record will be
created with the user name, forum id, and date/time. I am new to rails
and can think of a few ways of doing this, but I'm looking for an
easy/best practices way and was wondering what other people thought.

thanks,
-alex
Posted by Andreas S. (andreas)
on 2007-08-30 23:24
Create a new model "TopicVisits", with the fields "user_id", "forum_id" 
and "created_at". Then add the following code to the end of the method 
ForumController#forum in app/controllers/forum_controller.rb:
unless @user.guest?
  TopicVisit.create(:user_id => @user.id, :forum_id => @forum.id)
end
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.