Hi Everyone, Good Day! I wanna to add to my blog a counter for displaying, how many times was my website visited. I would like to solve it through ruby (not GA or something like that). Is available any gem that do this task (also with checking IP address,the time of latest visited and visited count). Please Advice. Thank You. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/qjFr5sHDkSwJ. For more options, visit https://groups.google.com/groups/opt_out.
check newrelic_rpm -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/tk0zRTlKS2UJ. For more options, visit https://groups.google.com/groups/opt_out.
Crispin Schäffler
2012-Dec-19 09:31 UTC
Re: Finding how many times was my website visited?
hey,
it actually is possible to do that... however, it will get very complex
when you want to have statistics and i would recommend something like new
relic or google analytics to use then... but thats not what you asked
for... so her i give you a quick and dirty example how you could do that:
rails g model Visit date:time ip:string (and what not you want to have)
then in your application_controller:
before_filter :track
def track
trackobject = Track.new(:date => Time.now, :ip =>
"#{request.env[''REMOTE_ADDR'']}") unless
session[:tracked] (and again what
you want to have
session[:tracked] = true (if you want that visitor only tracked once on your
page
end
Am Mittwoch, 19. Dezember 2012 07:54:20 UTC+1 schrieb
Maddy:>
> Hi Everyone,
>
> Good Day!
>
> I wanna to add to my blog a counter for displaying, how many times was my
> website visited. I would like to solve it through ruby (not GA or something
> like that). Is available any gem that do this task (also with checking IP
> address,the time of latest visited and visited count).
>
> Please Advice.
>
> Thank You.
>
--
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/E51rE_WJrsEJ.
For more options, visit https://groups.google.com/groups/opt_out.
Ashokkumar Yuvarajan
2012-Dec-19 10:04 UTC
Re: Re: Finding how many times was my website visited?
Hi Crispin Schäffler,
*
*
*Good Day !*
*
*
*As you said i followed your instructions, but i got an error..*
*
*
*It is my application controller,*
*
*
*
class ApplicationController < ActionController::Base
before_filter :track
def track
trackobject = Track.new(:date => Time.now, :ip =>
"#{request.env[''REMOTE_ADDR'']}") unless
session[:tracked]
session[:tracked] = true
end
end
*
*[image: Inline image 1]r
*
*Please advice!*
*
*
*Thank you.*
*
*
On Wed, Dec 19, 2012 at 3:01 PM, Crispin Schäffler <
crispinschaeffler-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> def track
> trackobject = Track.new(:date => Time.now, :ip =>
> "#{request.env[''REMOTE_ADDR'']}") unless
session[:tracked] (and again what
> you want to have
>
> session[:tracked] = true (if you want that visitor only tracked once on
your page
>
> end
>
--
*"Attitude is a little thing that makes a big difference"*
Thanks & Regards
*Ashokkumar.Y*
*ROR-Developer
**email : ashokkumar-tks5Z7IV8F8RmelmmXo44Q@public.gmane.org*
*Shriramits*
*
*
--
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Crispin Schäffler
2012-Dec-19 10:59 UTC
Re: Finding how many times was my website visited?
well... thats what happens if you write it quick and dirty. it was not meant to be copy and paste... sorry... but what exactly is line 7 of your applications controller? did you have sessioons enabled? Am Mittwoch, 19. Dezember 2012 07:54:20 UTC+1 schrieb Maddy:> > Hi Everyone, > > Good Day! > > I wanna to add to my blog a counter for displaying, how many times was my > website visited. I would like to solve it through ruby (not GA or something > like that). Is available any gem that do this task (also with checking IP > address,the time of latest visited and visited count). > > Please Advice. > > Thank You. >-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/ox5on2Nl6EMJ. For more options, visit https://groups.google.com/groups/opt_out.
On 19 December 2012 10:59, Crispin Schäffler <crispinschaeffler-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> well... thats what happens if you write it quick and dirty. it was not meant > to be copy and paste... sorry... but what exactly is line 7 of your > applications controller? did you have sessioons enabled?I think maybe the problem is that it should be trackobject = Visit.new( ... @OP I assume you are a newcomer to Rails. I think you might benefit from working right through a good tutorial such as railstutorial.org which is free to use online. Colin> > Am Mittwoch, 19. Dezember 2012 07:54:20 UTC+1 schrieb Maddy: >> >> Hi Everyone, >> >> Good Day! >> >> I wanna to add to my blog a counter for displaying, how many times was my >> website visited. I would like to solve it through ruby (not GA or something >> like that). Is available any gem that do this task (also with checking IP >> address,the time of latest visited and visited count). >> >> Please Advice. >> >> Thank You. > > -- > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-talk/-/ox5on2Nl6EMJ. > > For more options, visit https://groups.google.com/groups/opt_out. > >-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Thota praneeth
2012-Dec-19 11:20 UTC
Re: Re: Finding how many times was my website visited?
I hope you don''t have * Track Model with date and IP fields. * On Wed, Dec 19, 2012 at 4:44 PM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 19 December 2012 10:59, Crispin Schäffler > <crispinschaeffler-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > well... thats what happens if you write it quick and dirty. it was not > meant > > to be copy and paste... sorry... but what exactly is line 7 of your > > applications controller? did you have sessioons enabled? > > I think maybe the problem is that it should be > trackobject = Visit.new( ... > > @OP I assume you are a newcomer to Rails. > I think you might benefit from working right through a good tutorial > such as railstutorial.org > which is free to use online. > > Colin > > > > > Am Mittwoch, 19. Dezember 2012 07:54:20 UTC+1 schrieb Maddy: > >> > >> Hi Everyone, > >> > >> Good Day! > >> > >> I wanna to add to my blog a counter for displaying, how many times was > my > >> website visited. I would like to solve it through ruby (not GA or > something > >> like that). Is available any gem that do this task (also with checking > IP > >> address,the time of latest visited and visited count). > >> > >> Please Advice. > >> > >> Thank You. > > > > -- > > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit > > https://groups.google.com/d/msg/rubyonrails-talk/-/ox5on2Nl6EMJ. > > > > For more options, visit https://groups.google.com/groups/opt_out. > > > > > > -- > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit https://groups.google.com/groups/opt_out. > > >Thanks and Regards Praneeth Thota 9966590143 -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.