Project

micoo

0.0
A long-lived project that still receives updates
MICOO (Minimal Cookies) is a Rails engine to handle Cookies consent.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

 Project Readme

Micoo

Gem Version Downloads GitHub Build Ruby Style Guide MIT License

Micoo (minimal Cookie) is a Rails Engine handling the Cookie consent. Besides installing the gem just a minimal code is required (see Usage).

Micoo display a styled text including buttons for accepting, rejecting and customizing usage of cookies.

Clicking Accept set the cookie "cookiesOK" to "x", clicking Reject will delete the cookie, clicking Customize links to administration of cookies.

The cookie "cookiesOK" expires after one month.

Optional Parameter

Optional parameter for CookiesComponent.new(...) are:

text

Default is:

You may delete and block all cookies from this site, but parts of the site will not work.

Click Accept if you consent usage of cookies, otherwise click Reject.

Usage

# config/routes.rb
Rails.application.routes.draw do
  ...
  get "/cookies/accept"
  get "/cookies/reject"
  get "/cookies/customize
  ...
end
# app/controllers/application_controller.rb (recommended)
  ...
  before_action :always

  def always
    unless cookies[:cookiesOK] == "x"
      render CookiesComponent.new
    end
  end
  ...

Customize

The user should provide functionality for the Customize button.

Button Customize can be disabled/hidden by CSS.

I18n

You may provide an "internationalized" text via the text parameter.

Micoo buttons uses the I18n.translate method for the legends. A configuration file may contain:

# config/locales/en.yml
en:
  micoo:
    button:
      accept: Accept
      reject: Reject
      customize: Customize

Installation

As usual:

# Gemfile
gem "micoo"

and run "bundle install".

License

Copyright (c) 2024-2025 Dittmar Krall (www.matiq.com), released under the MIT license.