Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

micoo

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

micoo

  • 0.3.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Micoo

Gem Version GEM Downloads rake 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 or rejecting usage of cookies.

Clicking Accept set the cookie "cookiesOK" to "x", clicking Reject will delete the cookie.

Optional Parameters

Optional parameters 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.

url

Redirection to url will be triggered by clicking Accept or Reject. Default is request.url.

Usage

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

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

I18n

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

Micoo buttons uses the I18n.translate method for the legend. A configuration file (a sample) may be:

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

Installation

As usual:

# Gemfile
gem "micoo"

and run "bundle install".

License

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

FAQs

Package last updated on 10 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc