Hi, when I create the following method inside a controller, the result I get is not the one I am expecting. Anybody has an explanation for this strange behavior? --- code def strange if nil raise "strange" session = "whatever" end render :text => session.inspect end --- Thanks, Marek --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core -~----------~----~----~----~------~----~------~--~---
Hi Marek, On 1.10.2006, at 15.01, mck wrote:> > Hi, > > when I create the following method inside a controller, the result I > get is not the one I am expecting. > Anybody has an explanation for this strange behavior? > > --- code > def strange > if nil > raise "strange" > session = "whatever" > end > render :text => session.inspect > end > ---1) This list is for topics around developing the Rails core, not for general Rails questions. Please post your question to the general Rails mailing list (http://groups.google.com/group/rubyonrails-talk). 2) If you want to get a helpful answer to your question, you need to tell a lot more about your problem. What is the result you get? What is the result you expect? What is the "strange behaviour"? //jarkko -- Jarkko Laine http://jlaine.net http://odesign.fi
Hi jarkko, I thought it would be more appropriate on this list... The result I expect is a CGI::Session object, but I do get "nil". The strangeness factor lies in the code of the if statement, that is not executed, but alters my session object. Otherwise the "raise" would happen. My installed gems are: actionmailer (1.2.5) actionpack (1.12.5) actionwebservice (1.1.6) activerecord (1.14.4) activesupport (1.3.1) ajax_scaffold_generator (3.1.1) daemons (0.4.4) gem_plugin (0.2.1) money (1.7.1) mongrel (0.3.13.3) rails (1.1.6) rake (0.7.1) sources (0.0.1) - marek --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core -~----------~----~----~----~------~----~------~--~---