# Model-problem

**URL:** <https://www.ruby-forum.com/t/model-problem/177568>\
**Category:** Rails\
**Created:** [October 20, 2009, 11:36am UTC](https://www.ruby-forum.com/t/model-problem/177568 "2009-10-20T11:36:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![earthtree](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/d2c977/32.png) [@earthtree](https://www.ruby-forum.com/u/earthtree)\
**Post date:** [October 20, 2009, 11:36am UTC](https://www.ruby-forum.com/t/model-problem/177568/1 "2009-10-20T11:36:46Z")

</div>

Hello.  
I have a simple multipart-form that uploads images and saves record in  
the database. I have a model that uses the RMagick plugin to save the  
images.

My model looks like this:  
class Drawing \< ActiveRecord::Base

has\_attachment :storage =\> :file\_system,  
:resize\_to =\> ‘670x503’,  
:thumbnails =\> { :thumb =\> ‘160x120’, :tiny =\> ‘50\>’ },  
:max\_size =\> 5.megabytes,  
:content\_type =\> :image,  
:processor =\> ‘Rmagick’  
validates\_as\_attachment  
acts\_as\_rateable

belongs\_to :member  
belongs\_to :drawingcategory  
has\_many :drawingcomments  
end

I also have a drawing-tool done in Flash. The idea is to draw in the  
flash-application and then save the drawing online. I have functionality  
so I can get the image saved on the server, but I do not know how I can  
connect that image to this rmagick-plugin and get the information about  
the drawing saved in the same table as the drawings uploaded through the  
multipart-form.

I have looked everywhere and tried everything. Anyone who can help me?
