vendredi 11 mars 2016

Add value to column in database via the rails console

I have a table in my database called "users". In this table, I have 4 columns: Firstname, Lastname, Age, Location (all created with the usual: rails generate migration add_firstname_to_users firstname:string).

If I have an existing user with the columns FirstName, Lastname, and Age already populated but Location is empty, how can I add a value to Location for a specific user via the rails console? Been googling all day, cant seem to find an answer.

Thanks!

Aucun commentaire:

Enregistrer un commentaire