# Editing FlexImage - image required?

**URL:** <https://www.ruby-forum.com/t/editing-fleximage-image-required/113234>\
**Category:** Rails\
**Created:** [August 29, 2007, 4:06am UTC](https://www.ruby-forum.com/t/editing-fleximage-image-required/113234 "2007-08-29T04:06:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/9f8e36/32.png) [@kim](https://www.ruby-forum.com/u/kim)\
**Post date:** [August 29, 2007, 4:06am UTC](https://www.ruby-forum.com/t/editing-fleximage-image-required/113234/1 "2007-08-29T04:06:12Z")

</div>

I am trying to edit a model with a fleximage. I can create the model  
with out the image by adding:  
self.require\_image\_data = false

But once a user has added an image they can only upload new images not  
remove the image. When I try to set the model.data = nil  
I get the following error:  
Exception in edit\_module: /var/www/ica/html/trunk/public/…/config/…/  
vendor/plugins/flex\_image/lib/flex\_image/model.rb:161:in `data='n

Obviously it is failing in the data.size \>0 line in the data= method.  
But shouldn’t the require\_image\_data=false fix that. I mean how is it  
creating models without images. I looked in the log and the sql is  
setting data = NULL. I tried that in the controller and it failed.

Any Ideas on what I should do?

Thanks, K

---

<div class="post-metadata">

**Author:** ![kim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/9f8e36/32.png) [@kim](https://www.ruby-forum.com/u/kim)\
**Post date:** [August 30, 2007, 10:29pm UTC](https://www.ruby-forum.com/t/editing-fleximage-image-required/113234/2 "2007-08-30T22:29:51Z")

</div>

Still need help with this. Is it just so easy? I would love some help.  
Thanks.
