23
Apr
07

!map:HashWithIndifferentAccess

i got some errors on my ruby on rails project, when i tried to get strings from two different hashes.

it catched all the data, but it added always !map:HashWithIndifferentAccess in front of my data.

i solved that by doing a little trick.

comment.title = params[:title]

and changed it so use only the data from the hash i want to use

comment.title = params[:title][:thefieldiwanttouse].to_s




    1 Response to “!map:HashWithIndifferentAccess”


    1. 1 zaj May 24th, 2007 at 2:24 am

      are you getting this with use of acts_as_commentable? I am when I store the value from params[:comment]…

      I wonder if it’s tied to something in the plugin, because when I look at the value from params[:comment], it’s clean… and after assignment to comment.comment it is too… but when it gets saved it gets that msg prepended.

      Strange, but you’re hack works for me too. Thx

    Comments are currently closed.