Forum: Ruby on Rails Fleximage syntax error

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
420aefb1d5de8150ec86fb240196e1be?d=identicon&s=25 Andrew Madu (Guest)
on 2007-03-08 19:12
(Received via mailing list)
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
This topic is locked and can not be replied to.