Module: Effective::EffectiveDatatable::Cookie

Included in:
Datatable
Defined in:
app/models/effective/effective_datatable/cookie.rb

Constant Summary collapse

2500

Instance Method Summary collapse

Instance Method Details



6
7
8
# File 'app/models/effective/effective_datatable/cookie.rb', line 6

def cookie
  @cookie
end


10
11
12
# File 'app/models/effective/effective_datatable/cookie.rb', line 10

def cookie_key
  @cookie_key ||= (datatables_ajax_request? ? view.params[:cookie] : cookie_param)
end

All possible dt cookie keys. Used to make sure the datatable has a cookie set for this session.



15
16
17
# File 'app/models/effective/effective_datatable/cookie.rb', line 15

def cookie_keys
  @cookie_keys ||= Array(@dt_cookie).compact.map(&:first)
end


19
20
21
# File 'app/models/effective/effective_datatable/cookie.rb', line 19

def cookie_param
  [self.class, attributes].hash.to_s.last(12)
end