# Best way to maintian a users viewing history

**URL:** <https://www.ruby-forum.com/t/best-way-to-maintian-a-users-viewing-history/89924>\
**Category:** Rails\
**Created:** [March 23, 2007, 8:59pm UTC](https://www.ruby-forum.com/t/best-way-to-maintian-a-users-viewing-history/89924 "2007-03-23T20:59:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jgrosjean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ecc23a/32.png) [@jgrosjean](https://www.ruby-forum.com/u/jgrosjean)\
**Post date:** [March 23, 2007, 8:59pm UTC](https://www.ruby-forum.com/t/best-way-to-maintian-a-users-viewing-history/89924/1 "2007-03-23T20:59:37Z")

</div>

I’d like for uses to my site to be able to tell what content has changed  
since they last viewed it. To do this I’ll need to record each time a  
user views some content and store the content id and time in the users  
viewing history.

This seems fairly strait forward, except I know I’m not supposed to  
change the database on GET requests, but in this case I’ll need to add a  
history record for the user each time they GET a new piece of content.  
Is there some way to get this history behavior and follow the rules too?  
Or maybe the rules don’t apply in this case since the history creation  
will only happen for logged in users, nothing will be changed if it’s  
just an anonymous bot visiting the site?

Second can anyone recommend any plugins or rails apps that already  
maintain this sort of viewing history that I could look at and learn  
from?

Thanks,  
Jesse
