You might also want to add that since strings and symbols are not the same myhash[:key] != myhash["key"] for regular hashes.
That means if you copy your paramaters hash from the error page during testing with something like > params={"key" => "value"} when you paste your code from your controller which says > if params[:key] == "value" it will fail....
Rails has a special HashWithIndifferentAccess class just for the parameters :) So, if you do > params=HashWithIndifferentAccess.new first, followed by > params=params.merge({"key" => "value"})
no subject
You might also want to add that since strings and symbols are not the same myhash[:key] != myhash["key"] for regular hashes.
That means if you copy your paramaters hash from the error page during testing with something like
> params={"key" => "value"}
when you paste your code from your controller which says
> if params[:key] == "value"
it will fail....
Rails has a special HashWithIndifferentAccess class just for the parameters :)
So, if you do
> params=HashWithIndifferentAccess.new
first, followed by
> params=params.merge({"key" => "value"})
then params[:key] == "value" will be true