Class: Initforthe::Cookies::PolicyController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/initforthe/cookies/policy_controller.rb

Instance Method Summary collapse

Instance Method Details

#acceptObject



2
3
4
5
6
7
8
9
# File 'app/controllers/initforthe/cookies/policy_controller.rb', line 2

def accept
  cookies[:cookie_policy] = { expires: 1.year.from_now, value: 'accepted' }

  respond_to do |format|
    format.json { render json: {} }
    format.html { redirect_to main_app.url_for '/' }
  end
end