| Web Development >> Ruby On Rails |
Dangers of Model in Session
| Language : | English | Quality : | High | Has Audio : | true | Source : | Other | Media : | QuickTime |
| Be careful when storing a model in a session. It will behave differently than you expect and can easily get out of sync with the database. Instead of storing the model directly in the session, store the id to the model and use that to fetch it from the database. |
Tags: Ruby On Rails, Ruby, Web Development, Screencast, Session, Model, Database, [SUGGEST A TAG]
Resources referenced in this screencast
|
Articles Realted to this Topic |
[SUGGEST A ARTICLE] |
|
RESTless design - do I need a session controller/model? Today the underground team of rorBB (an as-yet-unannounced Rails BB) saw that the application was almost completely RESTful – except in it’s login/logout actions on the users controller. It was Ben who pointed out that it was the single thing destroying our otherwise pretty URLs and we decided to do something about it. |
