Hey guys, I do an ajax call to update a div in my view with a different partial. The new partial uses data that was originally queried when the page was loaded. It is kinda redundant to have to requery that record again. Is the best solution to use flash to pass the result set. I guess, my question is, Does flash get stored on the client side, or on the server side. If its only the client side then flashing would make sense. On the other hand, if I am just requerying the database using the "ID" field, isn''t that ultra fast and takes very little resources where it wont matter if I just requery for that specific result? -- 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 -~----------~----~----~----~------~----~------~--~---
In other words, is it worth using the select statement from a result statement instead of requerying that specific item using find(id)? Eric Gross wrote:> Hey guys, > > I do an ajax call to update a div in my view with a different partial. > The new partial uses data that was originally queried when the page was > loaded. It is kinda redundant to have to requery that record again. > > Is the best solution to use flash to pass the result set. I guess, my > question is, > > Does flash get stored on the client side, or on the server side. > > If its only the client side then flashing would make sense. > > On the other hand, if I am just requerying the database using the "ID" > field, isn''t that ultra fast and takes very little resources where it > wont matter if I just requery for that specific result?-- 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 -~----------~----~----~----~------~----~------~--~---
The other option would be to store it in the session(not the flash - that doesn''t stick around between requests), but if you''re using the database as the session store, then it''s the same thing. You Could also insert the ID or whatever you need to store into the AJAX params, that way it would be "stored" in the HTML on the client machine. Eric Gross wrote:> In other words, is it worth using the select statement from a result > statement instead of requerying that specific item using find(id)? > > Eric Gross wrote: > >> Hey guys, >> >> I do an ajax call to update a div in my view with a different partial. >> The new partial uses data that was originally queried when the page was >> loaded. It is kinda redundant to have to requery that record again. >> >> Is the best solution to use flash to pass the result set. I guess, my >> question is, >> >> Does flash get stored on the client side, or on the server side. >> >> If its only the client side then flashing would make sense. >> >> On the other hand, if I am just requerying the database using the "ID" >> field, isn''t that ultra fast and takes very little resources where it >> wont matter if I just requery for that specific result? >> > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
What do you mean using the database as the session store? On this note, is there any advantage to using flash with flash.keep across actions as opposed to session? Is it less "resource intensive" or bulky to use flash or does it not matter since its both stored on the clients machine. So Jason, what I understand from your response is that by storing the ID and requerying that specific entry from the database using find is really negligable as far as taking up database querying resources? Jason Norris wrote:> The other option would be to store it in the session(not the flash - > that doesn''t stick around between requests), but if you''re using the > database as the session store, then it''s the same thing. You Could also > insert the ID or whatever you need to store into the AJAX params, that > way it would be "stored" in the HTML on the client machine.-- 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 -~----------~----~----~----~------~----~------~--~---
1.) Neither Flash nor Session are stored on the client machine. They are all on the server. 2.) By default, rails stores session information on the filesystem. This is fine, unless you need to share sessions across servers in which case you can have Rails store session data in the database. It''s easy if you want to go that route. Google it. 3.) Yes, running a one-item query by ID is the easiest thing a DB server can do. Unless you want to do :select => ''SQL_CACHE *'' which will do a cached query, thus increasing database speed as much as humanly possible. Jason On 10/19/06, Eric Gross <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > What do you mean using the database as the session store? On this note, > is there any advantage to using flash with flash.keep across actions as > opposed to session? Is it less "resource intensive" or bulky to use > flash or does it not matter since its both stored on the clients > machine. > > So Jason, what I understand from your response is that by storing the ID > and requerying that specific entry from the database using find is > really negligable as far as taking up database querying resources? > > > Jason Norris wrote: > > The other option would be to store it in the session(not the flash - > > that doesn''t stick around between requests), but if you''re using the > > database as the session store, then it''s the same thing. You Could also > > insert the ID or whatever you need to store into the AJAX params, that > > way it would be "stored" in the HTML on the client machine. > > > -- > 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 -~----------~----~----~----~------~----~------~--~---
Thanks for your response Jason. So which route would you go in the case of ajax calls, would you flash over the orginal result set? Or would you just pass the id and query that from the database? Or is one way not really better than the other? Im trying to build my app to be as scalable as possible. -- 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 -~----------~----~----~----~------~----~------~--~---