I set a session variable like this: session[:jump_to] = @request.parameters Then in a controller I do this: if session[:jumpt_to].nil? redirect_to :controller => "entrance" else redirect_to :controller => session[:jump_to] ["controller"], :action => session[:jump_to]["action"], :id => session [:jump_to]["id"] end I output my session[:jump_to] and it is for sure set. No matter what the first if statement is true, when I set it and when I don''t set it. Anyone have any insight?
I''m not sure if it''s a typo in your email or your code, but the controller has :jumpt_to with an extra t after the p. Chris On 6/2/05, John Kopanas <john.kopanas-O1KSuMybMhqBUy7/sJONFg@public.gmane.org> wrote:> I set a session variable like this: > > session[:jump_to] = @request.parameters > > Then in a controller I do this: > > if session[:jumpt_to].nil? > redirect_to :controller => "entrance" > else > redirect_to :controller => session[:jump_to] > ["controller"], :action => session[:jump_to]["action"], :id => session > [:jump_to]["id"] > end > > I output my session[:jump_to] and it is for sure set. No matter what > the first if statement is true, when I set it and when I don''t set it. > > Anyone have any insight? > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Wow... that is after staring at this code for 3 hours. Damm... Pair programming... I am all for it! On 2-Jun-05, at 11:53 AM, Chris McGrath wrote:> I''m not sure if it''s a typo in your email or your code, but the > controller has :jumpt_to with an extra t after the p. > > Chris > > On 6/2/05, John Kopanas <john.kopanas-O1KSuMybMhqBUy7/sJONFg@public.gmane.org> wrote: > >> I set a session variable like this: >> >> session[:jump_to] = @request.parameters >> >> Then in a controller I do this: >> >> if session[:jumpt_to].nil? >> redirect_to :controller => "entrance" >> else >> redirect_to :controller => session[:jump_to] >> ["controller"], :action => session[:jump_to]["action"], :id => >> session >> [:jump_to]["id"] >> end >> >> I output my session[:jump_to] and it is for sure set. No matter what >> the first if statement is true, when I set it and when I don''t set >> it. >> >> Anyone have any insight? >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >