Question about instant variable in views and request paramet

Hi all,

I have a difficulty which I would like to ask for help.

I passed parameters to a view in the form of URL parameters
(…?param1=xxx&param2=yyy), and use these parameters to initialize an
instant variable (say @var1) in an action method of my controller. In
that view there’re some AJAX stuffs. Following are my difficulty:

  1. In subsequent action methods called by AJAX, I need to access the
    @var1 (already initialized before), but @var1 return nil. How could i
    keep the value of @var1 across action methods? I guess the controller
    is singleton, so @var1 will be like a global variable and its value
    will be kept available across requests - but clearly it’s not the case.
    Could anyone explain how I’m wrong?

  2. I would like to re-initialize @var1 using request parameters
    (param1, param2…). However in subsequent action methods called by
    AJAX stuffs, how can I access these parameters, as they’re not in
    params any more (they’re still there on URL).

Sorry for these newbie questions. Thank a lot for help.

  • Chuong