Permalink
Browse files

Add view helper for toggling cookie notifications.

  • Loading branch information...
1 parent def3868 commit 78720aa1023d082d401ebc65ada171849bf8c14e @piotrmurach committed Jul 7, 2012
Showing with 15 additions and 0 deletions.
  1. +15 −0 lib/rack/policy/helpers.rb
@@ -0,0 +1,15 @@
+# -*- encoding: utf-8 -*-
+
+module Rack
+ module Policy
+ module Helpers
+
+ def cookies_accepted?
+ accepted = !request.env['rack-policy.consent'].nil?
+ yield if block_given? && accepted
+ accepted
+ end
+
+ end # Helpers
+ end # Policy
+end # Rack

0 comments on commit 78720aa

Please sign in to comment.