Re: Age Verify

Ryan Bigg
2007-12-21T06:34:19Z

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
<eberner-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 Bigg
http://www.frozenplague.net

--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org