Search code examples
ruby-on-railsrubygon

Rails, Gon - You can't use Gon public methods for storing data


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.


Solution

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