Thanks for your reply. I will do research on memcached Yudi Soesanto
On Fri, Mar 19, 2010 at 5:36 AM, Andy Jeffries <andyjeffr...@gmail.com>wrote: > On 19 March 2010 08:12, Yudi Soesanto <soesa...@gmail.com> wrote: > >> Hi, >> >> Anyone knows how to preserve the value from the previous action >> controller? >> >> For example, >> - I have 2 controllers: foo_one and foo_two. >> - on action foo_one, I have variable @my_value >> - How I can keep the value of @my_value so I can use it on the second >> controller foo_two >> >> def foo_one >> @my_value = params[:preserve_value] >> end >> >> def foo_two >> puts @preserve_value >> end >> >> >> I don't want to use session or global variable. any suggestion? >> > > Assuming foo_one calls foo_too (so it's in the same request - hence your > global variable mention), then you could define an attr_accessor on > foo_two's controller and set it from there. > > But, if it's not being executed in the same request, session (be it Rails > session, database or memcached) is the only way (or flash so it's > automatically removed after the next request). > > Cheers, > > > Andy > > -- > 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-t...@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscr...@googlegroups.com<rubyonrails-talk%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.