Module: Biscuit::BiscuitHelper
- Defined in:
- app/helpers/biscuit/biscuit_helper.rb
Instance Method Summary collapse
-
#biscuit_allowed?(category) ⇒ Boolean
Returns true if the user has consented to the given category.
-
#biscuit_banner(**options) ⇒ Object
Renders the consent banner.
Instance Method Details
#biscuit_allowed?(category) ⇒ Boolean
Returns true if the user has consented to the given category. Safe to call even when no cookie exists — returns false.
14 15 16 |
# File 'app/helpers/biscuit/biscuit_helper.rb', line 14 def biscuit_allowed?(category) Biscuit::Consent.new().allowed?(category) end |
#biscuit_banner(**options) ⇒ Object
Renders the consent banner. If consent has already been given, renders only the minimal “Cookie settings” reopener link (hidden banner state).
6 7 8 9 10 |
# File 'app/helpers/biscuit/biscuit_helper.rb', line 6 def (**) = Biscuit::Consent.new() render partial: "biscuit/banner/banner", locals: { consent: , options: } end |