Damjan Rems
2013-Jun-03 06:07 UTC
Is it possible to run some script before controller is hit
This has everything to do with new European cookie law ;-( Is it possible to start some script (on every call), before rails application is hit. Script would check for the presence of a cookie and if it is there just pass control forward. If not it would popup window about legal stuff and redirect to original address. I am using Rails 3.2 with Passenger and Nginx. by TheR -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c1ed15ee2a9b31fbce714556275f17e9%40ruby-forum.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
Dheeraj Kumar
2013-Jun-03 06:10 UTC
Re: Is it possible to run some script before controller is hit
I''d do this in the client site - with javascript. -- Dheeraj Kumar On Monday 3 June 2013 at 11:37 AM, Damjan Rems wrote:> This has everything to do with new European cookie law ;-( > > Is it possible to start some script (on every call), before rails > application is hit. Script would check for the presence of a cookie and > if it is there just pass control forward. If not it would popup window > about legal stuff and redirect to original address. > > I am using Rails 3.2 with Passenger and Nginx. > > by > TheR > > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org (mailto:rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org). > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org (mailto:rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org). > To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c1ed15ee2a9b31fbce714556275f17e9%40ruby-forum.com?hl=en-US. > 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/FBC07D08F3474C86A2FA7318030C5676%40gmail.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
Frederick Cheung
2013-Jun-03 07:12 UTC
Re: Is it possible to run some script before controller is hit
On Monday, June 3, 2013 7:07:22 AM UTC+1, Ruby-Forum.com User wrote:> > This has everything to do with new European cookie law ;-( > > Is it possible to start some script (on every call), before rails > application is hit. Script would check for the presence of a cookie and > if it is there just pass control forward. If not it would popup window > about legal stuff and redirect to original address. > >There''s a rack middleware ( https://github.com/peter-murach/rack-policy ) that handles some of this. Fred> I am using Rails 3.2 with Passenger and Nginx. > > by > TheR > > -- > Posted via http://www.ruby-forum.com/. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0b6d96fe-c81a-4bad-87cc-0fe43b6c5ffd%40googlegroups.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
Robert Walker
2013-Jun-03 12:44 UTC
Re: Is it possible to run some script before controller is hit
Dheeraj Kumar wrote in post #1111091:> I''d do this in the client site - with javascript.JavaScript can easily be disabled by the user. The solution has to be done server side, so Rack middleware is the way to go as Frederick mentioned. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/601c6c5412c9daf370a1be1c3b04706a%40ruby-forum.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
Colin Law
2013-Jun-03 14:17 UTC
Re: Is it possible to run some script before controller is hit
On 3 June 2013 07:07, Damjan Rems <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> This has everything to do with new European cookie law ;-( > > Is it possible to start some script (on every call), before rails > application is hit. Script would check for the presence of a cookie and > if it is there just pass control forward. If not it would popup window > about legal stuff and redirect to original address.Out of interest is there a reason why this could not be done more simply using a before_filter? Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLuwH_jrx5vHPnEpo4eUA1T%2BEgVhVdV-z2TU5YbtuRZqrw%40mail.gmail.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.