Sorry, now that I reread my post, it's not very clear.
I am getting the error "can't add a new key into hash during iteration"
reported for this line of code:
params[:search_form] ||= {}
which makes no sense at all. The iteration examples in my first post
were just my way of explaining I understood the basic error msg and what
it would normally relate to. However, the actual error msg is not
tracing back to an iteration--just that simple line with params ||=.
Experimenting a little more, it appears it matters _where_ I use that
line of code.
I'm not sure how to distill this down, so here's the semi-detailed
version...
Two relevant files: a rails controller, and a module file stored in /lib
which gets included in ApplicationController.
OK, so the line that fails is the one shown just above. Now, if I move
that line out of the update_sticky_search method and into the
prep_view_y method just before the call to update_sticky_search, there
is no error. Bizarre!
So is update_sticky_search called from someplace that (among other
things) is iterating over params?