Class: Decidim::CookiePolicyController

Inherits:
ApplicationController show all
Defined in:
decidim-core/app/controllers/decidim/cookie_policy_controller.rb

Overview

This controller allows the user to accept the cookie policy.

Instance Method Summary collapse

Methods included from NeedsOrganization

enhance_controller, extended, included

Instance Method Details

#acceptObject



8
9
10
11
12
13
14
15
16
17
# File 'decidim-core/app/controllers/decidim/cookie_policy_controller.rb', line 8

def accept
  response.set_cookie "decidim-cc", value: "true",
                                    path: "/",
                                    expires: 1.year.from_now.utc

  respond_to do |format|
    format.js
    format.html { redirect_back fallback_location: root_path }
  end
end