radiokills / zekom

Implemets ZEKom-1 cookie directive to your rails app.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#Zekom This gem implements Slovenian version of European cookie directive.

Installation

Add to Gemfile:

gem 'zekom', :git => 'git://github.com/radiokills/zekom.git'

Run the install generator:

  $ rails g zekom:install

(Optional) Include zekom stylesheet in application.css

...
...
*= require_tree .
*= require 'zekom/zekom'
*/

Configuration

This gem comes with some general cookies descriptions. You can add your own in config/initializers/zekom.rb. You can supply cookies via hash.

Zekom::Kookie.add({
  :id=>'uservoice',
  :names=>'_uv, jv',
  :expires=>'_uv: 30min, jv: 12 min',
  :description=>'Ti piškotki se uporabljajo za podporo uservoice.' 
  })

At the end of file, you can fid this line

Zekom::Kookie.use_kookies = %w(adsense)

It defines the cookies you want to display in explanation section. In case of adding new cookies yourself you would change the line accordigly.

At the end of file, you can fid this line

Zekom::Kookie.use_kookies = %w(adsense uservoice)

Predifined cookies can be found here: https://github.com/radiokills/zekom/blob/master/app/data/cookie_list.yml

##Helpers

zekom_notification - Shows the notification about your page using cookies

cookie_list - Shows cookies descriptions (as defined in yaml file or initializer)

cookies_allowed_ - Returns true or false based on user previous decision

##Routes This gem adds two routes:

your_app/zekom/zekom/about - It displays basic cookie info and lists cookies (via cookie_list helper)

your_app/zekom/allow_cookies - It sets cookie which states that user agree with using cookies

About

Implemets ZEKom-1 cookie directive to your rails app.

License:MIT License


Languages

Language:Ruby 94.0%Language:JavaScript 6.0%