Justin Collins
10/6/2006 9:43:00 AM
Zouplaz wrote:
> Hello,
>
> Under Ruby On Rails, I would like to replace
>
> mouvement = Mouvement.find(params[:id])
> mouvement.statut = :traite
> mouvement.save!
>
> By
>
> Mouvement.update(params[:id], statut ='#{:traite}'")
>
> But this error occurs : undefined method `stringify_keys!' for "statut = traite":String
>
>
> I don't understand the meaning of the error. Why does Ruby doesn't knows how to convert the symbol :traite to a string representation ?
>
> Even statut ='#{:traite.to_s}'" don't work
>
> Any help ?
>
> Thank you
>
I can't tell you exactly, but I can give you a hint. It is converting :traite to a string. But, you have a mistype somewhere, because you have an uneven number of double quotes. I'm guessing that when you pasted/wrote the code in your email, this was obscured.
> Mouvement.update(params[:id], statut ='#{:traite}'")
^ ^^
You even have it again:
> Even statut ='#{:traite.to_s}'" don't work
^ ^^
Hope that helps.
-Justin