mardi 13 octobre 2015

Update hash with rails 4

I have an hash object

@deal_question = {"id"=>66480, "prize_id"=>4, "admin_user_id"=>1, "created_at"=>2015-09-20 18:37:29 +0200, "updated_at"=>2015-09-20 18:37:29 +0200, "deal_available"=>true}

How to update the value of deal_available to false

I tried this but it fails

 @deal_question['deal_available'] = false
    @deal_question.save

Aucun commentaire:

Enregistrer un commentaire