Module: Effective::EffectiveDatatable::Cookie
- Included in:
- Datatable
- Defined in:
- app/models/effective/effective_datatable/cookie.rb
Instance Method Summary collapse
- #cookie ⇒ Object
- #cookie_key ⇒ Object
-
#cookie_keys ⇒ Object
All possible dt cookie keys.
- #cookie_param ⇒ Object
Instance Method Details
#cookie ⇒ Object
5 6 7 |
# File 'app/models/effective/effective_datatable/cookie.rb', line 5 def @cookie end |
#cookie_key ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/models/effective/effective_datatable/cookie.rb', line 9 def @cookie_key ||= ( if datatables_ajax_request? view.params[:cookie] elsif datatables_inline_request? view.params[:_datatable_cookie] else end ) end |
#cookie_keys ⇒ Object
All possible dt cookie keys. Used to make sure the datatable has a cookie set for this session.
22 23 24 |
# File 'app/models/effective/effective_datatable/cookie.rb', line 22 def @cookie_keys ||= Array(@dt_cookie).compact.map(&:first) end |
#cookie_param ⇒ Object
26 27 28 |
# File 'app/models/effective/effective_datatable/cookie.rb', line 26 def [self.class, attributes].hash.abs.to_s.last(12) # Not guaranteed to be 12 long end |