0

I have following error when try login in app:

You can't use Gon public methods for storing data

Pointed to this code:

gon.current_user = { sn: current_user.sn }

Can you help me what is wrong with this code? I am using version 5.2.3 of Gon.

Maximi
  • 559
  • 5
  • 18

2 Answers2

1

Solved by redefining: gon.env = Rails.env to gon.enviro = Rails.env

Maximi
  • 559
  • 5
  • 18
0

I had a similar issue with the gon.

After some investigation, I was able to find that I was using gon ~> 5.2.0 in Gemfile, and when I updated the gems it got updated to 5.2.3.

I think in 5.2.3 the current_user was added to public methods list.

So I changed the gon ~> 5.2.0 to gon 5.2.0, and rebundled and the issue was gone.

C LOKESH REDDY
  • 230
  • 3
  • 9