If you don't want to store anything in the session, how about checking
the referrer url in your controller action?

def show
   @item = Item.find(params[:id])
   dont_log_page_view = request.env["HTTP_REFERER"] =~ /\/items\/
[EMAIL PROTECTED]/
   ...
end

That will check to see if the request for the item has come from the
same item page. (Modify the regexp as needed depending on your route)

Some browser plugins stop the browser from sending the http referrer
in the request, but as far as I know it's usually only the paranoid
who use those.

Jeremy

On Sep 9, 8:45 am, PeteSalty <[EMAIL PROTECTED]> wrote:
> we're trying to add a feature where we log a view each time a user
> looks at a particular item (it's being logged as a database record
> against the item id).
> Problem is, if that user refreshes the page we don't want it to
> register as another view. Users may or may not be logged in when
> viewing items so we can't log it against the user id.
>
> Any ideas?
>
> D
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to