Re: Page view count

James Brooks
2007-06-09T09:25:37Z

Hi,

Here''s what you _could_ do, you could create a PageHit model which
might
contain: request_uri and created_at. Every time a page is viewed, add a new
one of these objects. To ensure they are for page views, you could add code
for this to the top of your layouts (application.rhtml in layouts, or
whatever layouts your using).

ie, in application.rhtml
<% PageHit.create :request_uri => request.request_uri %>

Cheers,
  James

On 6/9/07, Tyche <chandra.sonia-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
>
>
> Hi,
> I am new to RoR and and web designing. I want to display page view
> count on my home page. How do I do that?
>
> Many thanks,
> Tyche
>
>
> >
>