On Lunes, 25 de Enero de 2010 23:44:25 Fiend escribió: > I am a semi-good Rails programmer, and I know with Rails 2.X and above > they changed the session that it is cookie-based. Okay, great, but for > some reason when I logout of my app and log back in, the columns I had > customized using the "Customize" option atop the scaffold are reset > every time. The session _does_ get cleared when you logout, but > shouldn't it retrieve user preferences such as Customize options from > the cookie that's stored on the clients computer? How do I go about > doing this? > > I don't particularly need the preferences to be encrypted or anything. > I just want to store the Customize preferences in a cookie, and when > the user logs back in, it should look in the cookie and retrieve those > preferences. I know how to apply them once retrieved, I just don't > know how to store such data in a cookie in Rails. > > I apologize, this seems more like a Rails question than > ActiveScaffold, although I am trying to store the state of the > "Customize" option that the ActiveScaffold in my application uses. > > Any ideas?
There is no Customize option in ActiveScaffold, maybe you are using some plugin, I don't know the code for that option, how is stored, so I can't help you without more information. Also, you are talking about logout of your application, and that is your custom code, how are you implementing logout? If you clear the session to logout you will erase customize options, if customize options are stored in the session. If you close your browser, session is lost, so you will lose your customize options if you store in the session too. Read ActionController::Cookies [1] in rails API. Maybe you want to store customize options in a cookie instead of a session. Although session is stored in a cookie by default, it's a session cookie, which only exists until you close the browser. [1] http://api.rubyonrails.org/classes/ActionController/Cookies.html -- Sergio Cambra .:: entreCables S.L. ::. Mariana Pineda 23, 50.018 Zaragoza T) 902 021 404 F) 976 52 98 07 E) [email protected] -- You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en.
