Giter VIP home page Giter VIP logo

Comments (11)

eshaam avatar eshaam commented on September 15, 2024

Same issue

from cookies_eu.

GregoireMorane avatar GregoireMorane commented on September 15, 2024

Same issue (ruby 2.6.6)

from cookies_eu.

Bertrand-Bichat avatar Bertrand-Bichat commented on September 15, 2024

I use Ruby 2.6.6 now, same issue. I don't use turbolinks.

I think it comes from the file '_consent_banner.html.erb' in views. There is this line to know if cookie bar is display or not :
<% if cookies && cookies['cookie_eu_consented'] != "true" %>

The problem is : 'cookies' variables is equal to a symbol :page (or :pages), so cookies['cookie_eu_consented'] is always equal to nil. How can I managed cookies to set cookies['cookie_eu_consented'] at true ? Is turbolinks mandatory ? I have seen this issue, but nothing works with me : #73

from cookies_eu.

frikkl avatar frikkl commented on September 15, 2024

Hello community,
i had the same problem, but i finally found a easy solution here:
https://discuss.rubyonrails.org/t/js-cookie/73808

terminal:
yarn add js-cookie
app/javascript/packs/application.js
window.Cookies = require("js-cookie")

from cookies_eu.

martinbarilik avatar martinbarilik commented on September 15, 2024

@frikkl it doesnt work for me tho ... I think the js-cookie is the completely different thing from cookies-eu

from cookies_eu.

gabskoro avatar gabskoro commented on September 15, 2024

Sorry guys, but I just can't reproduce it. Can someone pls share me a boilerplate where I can reproduce it? I'm now testing it on Rails 5 and 6, works fine :(

from cookies_eu.

 avatar commented on September 15, 2024

Same issue. I just checked the browser console and found some error there.
Uncaught TypeError: Turbolinks.clearCache is not a function

from cookies_eu.

martinbarilik avatar martinbarilik commented on September 15, 2024

It seems you have a problem with turbolinks, not cookie bar. Can you share a code where you use .clearCache function ?

from cookies_eu.

 avatar commented on September 15, 2024

I just integrated the gem. No external js is added for same.
Turbolinks.clearCache(), its already defined in gem's javascript file.
f497dd7#diff-8c3d240d047cd715dd245b524045d31bf6ec42867d418d145da6f471c8bfaa28.

Any suggestion to fix this, will be really helpful!
Thanks.

from cookies_eu.

martinbarilik avatar martinbarilik commented on September 15, 2024

Do you use turbolinks in you Rails app ? What rails version do you have ?

from cookies_eu.

 avatar commented on September 15, 2024

I am using rails 4.2.6. Yes,Turbolinks used in my application.

from cookies_eu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.