I am using a global array to accumulate controller output as it is added
to the display, eg, when the user adds more items to a list, I add them
to the global.

However, something strange is going on when I then try and use that
global array in a controller method.  In a nutshell:

@selected = Array.new
$shown.each { |thing| puts "->#{thing}<-"; @selected.push thing; }

@selected is the array I want to produce (for simplicity, in the example
here it should be identical to $shown).  When this runs, the puts
statement output is correct, and .each iterates thru the array.

But debugging with the next line:

@selected.each { |x| puts "XXX:"+x }

@selected is nil; it is not even an Array now!  There is output from
WEBrick mentioning an "authenticity_token", altho it doesn't appear to
be an error and I don't know if it is relevent, I have not been using
this for long:

Processing MainController#bysize (for 127.0.0.1 at 2009-05-23 20:36:27)
[POST]
  Parameters: {"authenticity_token"=>"5KvBJEMB3I....

Anyone know why, and if there is a work around?
-- 
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@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
-~----------~----~----~----~------~----~------~--~---

Reply via email to