# Clearing string attribute

**URL:** <https://www.ruby-forum.com/t/clearing-string-attribute/165071>\
**Category:** Rails\
**Created:** [April 8, 2009, 8:38pm UTC](https://www.ruby-forum.com/t/clearing-string-attribute/165071 "2009-04-08T20:38:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![deepak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7bcc69/32.png) [@deepak](https://www.ruby-forum.com/u/deepak)\
**Post date:** [April 8, 2009, 8:38pm UTC](https://www.ruby-forum.com/t/clearing-string-attribute/165071/1 "2009-04-08T20:38:37Z")

</div>

I am missing something very basic. I have a string attribute which I  
need to clear before saving the record.

model.attribute = nil is not working. It works fine for another  
attribute which is a number

The string attribute is nullable and was created via migration

Thanks,  
Deepak
