# Help with FlexImage

**URL:** <https://www.ruby-forum.com/t/help-with-fleximage/113120>\
**Category:** Rails\
**Created:** [August 27, 2007, 8:43pm UTC](https://www.ruby-forum.com/t/help-with-fleximage/113120 "2007-08-27T20:43:09Z")\
**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 27, 2007, 8:43pm UTC](https://www.ruby-forum.com/t/help-with-fleximage/113120/1 "2007-08-27T20:43:09Z")

</div>

I can upload, edit and view images just fine. But, I am having  
problems deleting the images.

I have tried:  
@mod.data = nil  
this returns the error:  
Exception in edit\_module: You have a nil object when you didn’t expect  
it!  
You might have expected an instance of Array.  
The error occured while evaluating nil.size

It looks like it is trying to resize the image which is now nil.

Also tried:

@mod.data = ’ ’  
This didn’t do anything

I am all ears on how to delete the image. Thanks.

## Model

class LibResource \< FlexImage::Model  
self.require\_image\_data = false  
pre\_process\_image :size =\> ‘250x250’

## Controller

if request.post?  
@mod.attributes = params[:mod] #updates the model as usual

…  
if params[:image\_options]  
option = params[:image\_options]  
if option == ‘Remove my image’  
@mod.data = nil  
@mod.save!  
end  
end

---

<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 28, 2007, 12:08am UTC](https://www.ruby-forum.com/t/help-with-fleximage/113120/2 "2007-08-28T00:08:37Z")

</div>

Bump. Help me please.
