# Fleximage syntax error

**URL:** <https://www.ruby-forum.com/t/fleximage-syntax-error/88179>\
**Category:** Rails\
**Created:** [March 8, 2007, 7:12pm UTC](https://www.ruby-forum.com/t/fleximage-syntax-error/88179 "2007-03-08T19:12:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![akm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/57b2e6/32.png) [@akm](https://www.ruby-forum.com/u/akm)\
**Post date:** [March 8, 2007, 7:12pm UTC](https://www.ruby-forum.com/t/fleximage-syntax-error/88179/1 "2007-03-08T19:12:45Z")

</div>

Hi,  
I am getting the following error message when using fleximage:

undefined method `data' for class`Stockimagestbl’  
{RAILS\_ROOT}/vendor/plugins/flex\_image/lib/flex\_image/model.rb:71:in  
`alias_method' {RAILS_ROOT}/vendor/plugins/flex_image/lib/flex_image/model.rb:71:in`binary\_column’  
{RAILS\_ROOT}/app/models/stockimagestbl.rb:4  
{RAILS\_ROOT}/app/controllers/unregistered\_controller.rb:21:in `artist’

My code is as follows:

Map:

class Stockimagestbl \< FlexImage::Model  
set\_primary\_key “item\_code”  
belongs\_to :stocktbl,  
:foreign\_key =\> “stock\_id”  
binary\_column :item\_photo

end

Controller:

class UnregisteredController \< ApplicationController

def artist  
@artistImage =  
Stockimagestbl.find(“2221bc21-0ce2-11db-abe1-000c6e65312d”)  
end

View:  
\<%= image\_tag url\_for(:controller =\> ‘unregistered’, :action =\>  
‘artist’,  
:id =\> @artistImage) %\>

My postgreSQL (8.2) table (Stockimagestbl) structure is comprised of the  
following columns:

1.item\_code: Primary Key  
2.item\_photo: bytea

What am I overlooking here?

–  
Regards

Andrew
