# Manipulating custom user fields from the Rails console

**URL:** <https://meta.discourse.org/t/manipulating-custom-user-fields-from-the-rails-console/218613>\
**Category:** Development\
**Tags:** rails-console, user-custom-fields\
**Created:** [February 17, 2022, 9:12pm UTC](https://meta.discourse.org/t/manipulating-custom-user-fields-from-the-rails-console/218613 "2022-02-17T21:12:08Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)\
**Post date:** [February 18, 2022, 6:44pm UTC](https://meta.discourse.org/t/manipulating-custom-user-fields-from-the-rails-console/218613/6 "2022-02-18T18:44:00Z")

</div>

> [@JammyDodger](#):
>
> `u.custom_fields["user_field_16"] = "Nil"`

Thank you - yes, that is what I should have used.

> [@fzngagan](#):
>
> By doing this, you’re replacing everything in the `u.custom_fields` hash with `{"user_field_16" => nil}` (note the nil without quotes)

Yup, that is exactly what happened. I felt pretty foolish afterwards!

---

_[View the full topic](https://meta.discourse.org/t/manipulating-custom-user-fields-from-the-rails-console/218613)._
