Hello, I want to know if RoR support Viewstate and Context like ASP.net or not, and if not, does RoR support another technique to save date other than session? thanks in advanced. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 1/6/08, Mohamed Saeed <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I want to know if RoR support Viewstate and Context like ASP.net or not, > and if not, does RoR support another technique to save date other than > session?There''s memcached: http://danga.com/memcached/ http://nubyonrails.com/articles/2006/08/17/memcached-basics-for-rails -- Greg Donald http://destiney.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Jan 7, 2008, at 11:00 AM, Greg Donald wrote:> On 1/6/08, Mohamed Saeed <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >> I want to know if RoR support Viewstate and Context like ASP.net or >> not, >> and if not, does RoR support another technique to save date other >> than >> session? > > There''s memcached: > > http://danga.com/memcached/ > > http://nubyonrails.com/articles/2006/08/17/memcached-basics-for-railsAnd regarding the OP''s question about Viewstate, the answer is no. The main logic behind Viewstate seems, to me, to be lightening the load of populating complicated Asp.Net controls. The cost of that is that you have to ship an encrypted hidden field called Viewstate round-trip for each page served. This can get pretty bandwidth intensive but it''s all about tradeoffs. Rails doesn''t have any of these controls, so repopulation is done in whatever programmatic way you, as the developer want. It doesn''t always make sense to repopulate controls -- just in cases where there has been, for example, an error in data entry. That means that for the error cases, you typically spit back the fields that posted and validated, and blank the rest (all of this is automatic if you follow convention). Is there any other compelling reason to use Viewstate on a non-Asp.Net app that I''m not aware of? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> Rails doesn''t have any of these controls, so repopulation is done in > whatever programmatic way you, as the developer want. It doesn''t > always make sense to repopulate controls -- just in cases where there > has been, for example, an error in data entry. That means that for the > error cases, you typically spit back the fields that posted and > validated, and blank the rest (all of this is automatic if you follow > convention). > > Is there any other compelling reason to use Viewstate on a non-Asp.Net > app that I''m not aware of?IIRC, Viewstate manages the current state of various server controls that don''t get replicated in HTML. For instance, the text value of a text field isn''t stored in viewstate, because it''s part of the POST request. But if you do something like change the color or size of a text field programmatically in a postback, that needs to be stored somewhere. Rails will never have anything like this because this just isn''t the way we write our apps. Whether that''s good or bad is another discussion, but I''d implement a plugin if I wanted this functionality. -- Rick Olson http://lighthouseapp.com http://weblog.techno-weenie.net http://mephistoblog.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---