Rails caching forms
i developed a project using Ruby on Rails and i having a huge problem after putting it on production environment.
All forms seems to being cached.
I开发者_JAVA百科f i fill a whole form and send it to the server, the next time i access that form to create a new object, all fields will be already filled with previous data. This only happens on production environment, and i found that when i set this line to false, everything works fine:
config.cache_classes = true
Seems that this cache_Classes is causing the problem but i think that maybe another thing is causing the problem because cache_classes would only cache classes and not forms and i think that i may have a great performance loss with this config setted to false.
Please help!
I found out what was the problem. In some models i was using cattr_accessor and i find that everything in forms that was being cached was the same fields i used cattr_accessor. Classes would be cached so seems that cattr_accessor would be cached too. I just replaced it with attr_accessor and everything works fine.
Thanks guys!
Try turning off your browser's auto form completion feature.
精彩评论