Class: UUCounter::ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/uu_counter/application_controller.rb

Direct Known Subclasses

TracksController

Instance Method Summary collapse

Instance Method Details



6
7
8
# File 'app/controllers/uu_counter/application_controller.rb', line 6

def fill_cookie
    set_cookie unless get_cookie
end


10
11
12
# File 'app/controllers/uu_counter/application_controller.rb', line 10

def get_cookie
    cookies[:uu_counter_token]
end

#get_fullpathObject



14
15
16
# File 'app/controllers/uu_counter/application_controller.rb', line 14

def get_fullpath
    request.fullpath
end


18
19
20
# File 'app/controllers/uu_counter/application_controller.rb', line 18

def set_cookie
    cookies.permanent[:uu_counter_token] = SecureRandom.hex(12)
end