Here is the full stack trace:
Processing UserController#update_activity (for 127.0.0.1 at 2009-11-09 21:08:58) [PUT]
Processing ApplicationController#update_activity (for 127.0.0.1 at 2009-11-09 21:08:58) [PUT]
/!\ FAILSAFE /!\ 2009-11-09 21:08:58 -0500
Status: 500 Internal Server Error
undefined method `each' for "4":String
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.3/lib/action_controller/base.rb:489:in `block in filter_parameter_logging'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.3/lib/action_controller/base.rb:496:in `block (3 levels) in filter_parameter_logging'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.3/lib/action_controller/base.rb:495:in `collect'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.3/lib/action_controller/base.rb:495:in `block (2 levels) in filter_parameter_logging'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.3/lib/action_controller/base.rb:489:in `each'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.3/lib/action_controller/base.rb:489:in `block in filter_parameter_logging'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.3/lib/action_controller/base.rb:493:in `block (2 levels) in filter_parameter_logging'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.3/lib/action_controller/base.rb:489:in `each'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.3/lib/action_controller/base.rb:489:in `block in filter_parameter_logging'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.3/lib/action_controller/base.rb:1315:in `log_processing_for_parameters'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.3/lib/action_controller/base.rb:1302:in `log_processing'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.3/lib/action_controller/base.rb:526:in `process'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.3/lib/action_controller/filters.rb:606:in `process_with_filters'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.3/lib/action_controller/rescue.rb:65:in `call_with_exception'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.3/lib/action_controller/dispatcher.rb:91:in `rescue in dispatch'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.3/lib/action_controller/dispatcher.rb:97:in `dispatch'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.3/lib/action_controller/dispatcher.rb:111:in `_call'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.3/lib/action_controller/dispatcher.rb:82:in `block in initialize'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/query_cache.rb:29:in `call'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/query_cache.rb:29:in `block in call'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/query_cache.rb:9:in `cache'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/query_cache.rb:28:in `call'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/activerecord-2.3.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/head.rb:9:in `call'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/methodoverride.rb:24:in `call'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.3/lib/action_controller/params_parser.rb:15:in `call'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.3/lib/action_controller/session/cookie_store.rb:93:in `call'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.3/lib/action_controller/reloader.rb:29:in `call'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.3/lib/action_controller/failsafe.rb:26:in `call'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/lock.rb:11:in `block in call'
<internal:prelude>:8:in `synchronize'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/actionpack-2.3.3/lib/action_controller/dispatcher.rb:106:in `call'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/rails-2.3.3/lib/rails/rack/static.rb:31:in `call'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/urlmap.rb:46:in `block in call'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `each'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `call'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/rails-2.3.3/lib/rails/rack/log_tailer.rb:17:in `call'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/content_length.rb:13:in `call'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/handler/webrick.rb:50:in `service'
C:/Ruby19/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
C:/Ruby19/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
C:/Ruby19/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
and here is the request immediately before that (i.e. when it is rendering the checkbox list and checking to see which activities should be selected):
Processing UserController#activity (for 127.0.0.1 at 2009-11-09 21:08:55) [GET]
Parameters: {"controller"=>"user", "action"=>"activity"}
[4;36;1mUser Load (1.0ms)[0m [0;1mSELECT * FROM "users" WHERE ("users"."id" = '2') LIMIT 1[0m
[4;35;1mUser Update (3.0ms)[0m [0mUPDATE "users" SET "last_request_at" = '2009-11-10 02:08:55', "updated_at" = '2009-11-10 02:08:55' WHERE "id" = 2[0m
Rendering template within layouts/application
Rendering user/activity
[4;36;1mActivity Load (1.0ms)[0m [0;1mSELECT * FROM "activities" [0m
[4;35;1mActivity Load (0.0ms)[0m [0mSELECT "activities".id FROM "activities" INNER JOIN "activities_users" ON "activities".id = "activities_users".activity_id WHERE ("activities"."id" = 1) AND ("activities_users".user_id = 2 ) LIMIT 1[0m
[4;36;1mActivity Load (1.0ms)[0m [0;1mSELECT "activities".id FROM "activities" INNER JOIN "activities_users" ON "activities".id = "activities_users".activity_id WHERE ("activities"."id" = 2) AND ("activities_users".user_id = 2 ) LIMIT 1[0m
[4;35;1mActivity Load (0.0ms)[0m [0mSELECT "activities".id FROM "activities" INNER JOIN "activities_users" ON "activities".id = "activities_users".activity_id WHERE ("activities"."id" = 3) AND ("activities_users".user_id = 2 ) LIMIT 1[0m
[4;36;1mActivity Load (0.0ms)[0m [0;1mSELECT "activities".id FROM "activities" INNER JOIN "activities_users" ON "activities".id = "activities_users".activity_id WHERE ("activities"."id" = 4) AND ("activities_users".user_id = 2 ) LIMIT 1[0m
[4;35;1mActivity Load (0.0ms)[0m [0mSELECT "activities".id FROM "activities" INNER JOIN "activities_users" ON "activities".id = "activities_users".activity_id WHERE ("activities"."id" = 5) AND ("activities_users".user_id = 2 ) LIMIT 1[0m
[4;36;1mActivity Load (0.0ms)[0m [0;1mSELECT "activities".id FROM "activities" INNER JOIN "activities_users" ON "activities".id = "activities_users".activity_id WHERE ("activities"."id" = 6) AND ("activities_users".user_id = 2 ) LIMIT 1[0m
Completed in 98ms (View: 28, DB: 6) | 200 OK [http://localhost/user/activity]
which seems to be working properly. The way I have all this set up is that this is a separate page to update the activities so at this point the user has already been created. I'm only trying to pass the user[activity_ids][] array here, which means that the rendered html looks like this:
<div>
<input id="user_activity_ids_" name="user[activity_ids][]" type="checkbox" value="2" />
Subscribe to literary magazines
</div>
<div>
<input id="user_activity_ids_" name="user[activity_ids][]" type="checkbox" value="3" />
Member of a book club
</div>
and it would seem there's a problem with passing the parameters because even if I try to change the action such that it ONLY renders the parameters I receive it still comes up with the same error, i.e. the parameters are messed up before the update action can really assume control.
Thanks,
Andrew