绑定 error,console.log 一下 data。
发现问题了
> ActiveRecord::SessionStore::Session.last.data
ActiveRecord::SessionStore::Session Load (0.2ms) SELECT `sessions`.* FROM `sessions` ORDER BY `sessions`.`id` DESC LIMIT 1
ArgumentError: undefined class/module User
Session 在反序列化的时候,找不到 User 和 Article 类,导致解析失败。开发环境下 Model 每次都需要重新载入。
Session 里面不放对象是好习惯,如果一定要放就要打补丁,比较麻烦我就不说了。
报名了。
有可能是 bug 了,rails 什么版本?升到最新看看。push 到 github 上我跑一跑。
日志贴全啊不要删减,只露一角怎么看真相呢?
我觉得客户端框架,搜索引擎收录很成问题。
assets 编译之后就不会变了,放常量可以,放不了变量。
这颜色无法直视,看不清问题。
Turbolinks will evaluate any script tags in pages it visit, if those tags do not have a type or if the type is text/javascript. All other script tags will be ignored.
As a rule of thumb when switching to Turbolinks, move all of your javascript tags inside the head and then work backwards, only moving javascript code back to the body if absolutely necessary.
你的想法是可行的,官方推荐还是放到 head,我还没想清楚为什么。
#16 楼 @jiang_plus 上图好了
这要看数据量和程序复杂度。