Class: Decidim::CookiePolicyController

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

Overview

This controller allows the user to accept the cookie policy.

Instance Method Summary collapse

Instance Method Details

#acceptObject



10
11
12
13
14
15
16
17
18
19
# File 'app/controllers/decidim/cookie_policy_controller.rb', line 10

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