lastest.trick-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jul-20 00:32 UTC
Passing data between controller methods
Hi All What is the best way to pass data between different controller methods in support of different views? Thanks --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
lastest.trick-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> Hi All > > What is the best way to pass data between different controller methods > in support of different views? > > ThanksI am trying to do the same but it looks like every controller gets its own session, so variables can''t be exchanged via session[]. It looks like rails feature. Has anyone been dealing with the same problem. by TheR -- 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 -~----------~----~----~----~------~----~------~--~---
Could you please explain what you mean by "passing data"? Do you mean calling other methods in a controller or do you mean keeping information around through different requests. If you mean the latter, then your session is the way to go if that information is not fit to be in the database. Damjan, could you expound on your response? Controllers do not get their own session. The session is the construct built to keep information around for the entire time a user is using your site. Jason On 7/23/07, Damjan Rems <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > lastest.trick-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote: > > Hi All > > > > What is the best way to pass data between different controller methods > > in support of different views? > > > > Thanks > > I am trying to do the same but it looks like every controller gets its > own session, so variables can''t be exchanged via session[]. > > It looks like rails feature. > > Has anyone been dealing with the same problem. > > > > by > TheR > -- > 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 -~----------~----~----~----~------~----~------~--~---
Jason Roelofs wrote:> Could you please explain what you mean by "passing data"? Do you mean > calling other methods in a controller or do you mean keeping information > around through different requests. > > If you mean the latter, then your session is the way to go if that > information is not fit to be in the database. > > Damjan, could you expound on your response? Controllers do not get their > own > session. The session is the construct built to keep information around > for > the entire time a user is using your site. > > JasonI was playing with Ajax today and got this strange behaviour. If the Ajax called method was in the same controller class, then Ajax call had the same session ID (cleary seen in Mongrel). If the Ajax response method was in another controller class, the call got different session ID an thus proper session[] could not be reached in caller method. I was testing loading some Ajax data on page load and it made me crazy for over an hour until I changed the program and call Ajax method within same controller. by TheR -- 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 -~----------~----~----~----~------~----~------~--~---