Zouplaz wrote:
> Mouvement.update(params[:id], statut ='#{:traite}'")
This isn't valid, did you mean? (note, the ")
Mouvement.update(params[:id], "statut ='#{:traite}'")
The problem is not that Ruby can't stringify :traite, instead the
problem is that you've not read the RoR docs on update() well enough.
Please see:
http://api.rubyonrails.com/classes/ActiveRecord/Base.html#M000864
If you've read this, you'd change your code to look like this:
Mouvement.update(params[:id], { :statut => 'traite' })
Or, better yet
Mouvement.find(params[:id]).update_attribute(:statut, 'traite')
Note, Rails will take the symbol and use to_yaml instead of to_s when
it saves the record, so you should explictly change it to a string
yourself before passing it in the update hash.