Re: Age Verify

edberner
2007-12-21T06:36:19Z

What is preventing someone from doing a fake POST request on the adult
action?

On Dec 21, 1:34 am, "Ryan Bigg"
<radarliste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
> I would store it as session[:adult] rather than [:age], but it seems like
an
> ok way to do it.
>
> On Dec 21, 2007 5:02 PM, edberner
<eber...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
>
>
>
>
> > Is this the best way to do this?
>
> > class ApplicationController < ActionController::Base
> >  before_filter :adult?
>
> >  def adult?
> >    session[:age] == true
> >  end
>
> >  def adult
> >    session[:age] = true
> >    redirect_to :back
> >  end
> > end
>
> > In view:
> > <%= button_to "Enter", { :action => "adult"
} %>
>
> --
> Ryan Bigghttp://www.frozenplague.net