title: Rails 3: Determine if a user has viewed data
body: <p>I'd like to modify the contents of a controller's <code>index.html.erb</code> page based on whether or not a user has previously viewed records associated with that controller.</p>
  
  <p>In my particular case, I have an Item model, Items controller, and an Items view. The Item's view <code>index.html.erb</code> displays a link to each Item. I need to setup this view such that if an item has been viewed previously, then its link on <code>index.html.erb</code> would be in italics. If it had not been viewed, the link would be in boldface.</p>
  
  <p>Visually, this approach is similar to an e-mail inbox, where items that have not been viewed have subject headings listed in bold face and viewed items have a regular font weight.</p>
  
  <p>My question is similar to this <a href="https://stackoverflow.com/questions/297048/best-way-to-determine-if-a-user-has-viewed-data">previous stack overflow post</a>; however, that post provides a general answer related to database structure. I'm curious to know if there is a ''Rails way'' to achieve this behavior that I am missing. If the linked post is appropriate, can anyone offer suggestions as how to achieve the posts' recommended solution using Rails?</p>
  
  <p>I could rely on the browser and use the appropriate CSS to style visited and unvisited URLs, but for other reasons relevant to my project (but not this question, really) I'd rather have a solution that relies on Rails, hooks, and/or the database. I'm also up for other solutions (e.g., jQuery-based) if there's no straightforward Rails way of doing this. </p>