- Will work 'straight out the box' without any additional configuration
Install the configuration & view files
rails g cookie_alert:install
app/helpers/application_helper.rbfile to include the CookieAlert module:
config/routes.rbfile to add the CookieAlert route:
mount CookieAlert::Engine => "/cookie-alert"
in application.js add
//= require cookie_alert
in application.css add
*= require cookie_alert
To remove the installed files run
rails g cookie_alert:uninstall
To display the Cookie Alerts, simply call the following method from your layout
<%= display_cookie_alert %>
How It Works
After the Primary Alert has been displayed a number of times (5 by default) it is replaced by a Secondary Alert. By default this is a smaller box fixed to the bottom-left of the screen which transforms back to the the large banner when moused-over.
The visitor can click a link to 'hide the banner', thereby accepting the notice, and the Alerts will no longer be displayed for the remainder of the session.
CookieAlert can be configured to:
- Display a Primary Alert message until the visitor clicks the 'accept' link.
- Display a Primary Alert message which, after a number of views, changes to a Secondary Alert message until the visitor clicks the 'accept' link.
- Display a Primary Alert message then, after a number of views, stop showing any alert messages at all.
Please check the WIKI for a full list of the configuration options available.
Note that CookieAlert is designed to allow you to display alerts - the content and wording of the alert is entirely your own responsibility. KatanaCode do not warrant in any way that the default message, operation or usage of this Gem will make you compliant with the EU Cookie Law. It is up to you to ensure compliance!
All we can say is that we use it ourselves.
If you discover a problem with CookieAlert, please let us know about it.
Remember to search the issues list first in case your issue has already been raised by another Githuber
Full documentation is available here: http://rubydoc.info/gems/cookie_alert
You're welcome to contribute to CookieAlert. Please consult the contribution guidelines for more info.
Copyright 2013 Katana Code Ltd.
See MIT-LICENSE for full details.
About Katana Code
Katana Code are iPhone app and Ruby on Rails Developers in Edinburgh, Scotland.