当尝试在app中登录时,我有以下错误:
You can't use Gon public methods for storing data指向此代码:
gon.current_user = { sn: current_user.sn }你能帮我一下这段代码有什么问题吗?我正在使用Gon的5.2.3版本。
发布于 2017-04-28 14:39:18
通过重新定义: gon.env = Rails.env到gon.enviro = Rails.env来解决
发布于 2019-06-05 13:19:41
我也有过类似的问题。
经过一些调查,我发现我在Gemfile中使用Gemfile中的~> 5.2.0,当我更新Gemfile中的gems时,它被更新为5.2.3。
我认为在5.2.3中,current_user被添加到了公共方法列表中。
因此,我将~> 5.2.0更改为GON5.2.0,并重新打包,问题就解决了。
https://stackoverflow.com/questions/43677195
复制相似问题