Re: Merging params into another hash

Frederick Cheung
Sat, 29 Dec 2007 12:38:34 -0000

On 28 Dec 2007, at 22:45, Phillip Koebbe wrote:

>
>
> On Dec 28, 2007, at 3:43 PM, Mark Wilden wrote:
>
>>
>> On Dec 28, 12:17 pm, Phillip Koebbe
<phillipkoe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>
>>> params is a HashWithIndifferentAccess while my session
>>> [:people_search] was just a plain old Hash.  When I changed the
>>> instantiation of session[:people_search] to
>>> HashWithIndifferentAccess, it works.
>>
>> Just for my education, would changing the keys from symbols to
>> strings
>> also have worked?
>
> Well, apparently for my education, too.  Changing the keys from
> symbols to strings does, in fact, work.
>
Because in the HashWithIndifferentAccess you get as params the keys
are, deep down on the inside, strings, so when you merged that into
your array you got a bunch of string keys but you were looking for
symbol keys.

Fred

> Why?
>
> Phillip
>
>
> >