Age Verify

edberner
2007-12-21T06:32:04Z

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" } %>

--~--~---------~--~----~------------~-------~--~----~
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