Forum: Ruby on Rails [file_column] Problem displaying images after upload

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.
C204883ecbdf04c9a5bc9b024f5ed575?d=identicon&s=25 Bill Pennington (Guest)
on 2006-01-12 06:32
(Received via mailing list)
This is the last major hurdle in my little app and I can't seem to
figure it out. I am using file_column to upload images. The upload
(and rmajick goodness) works just fine, but when I try to display the
resulting image I get this error:

undefined method `image_relative_path' for #<Array:0x252b694>

In script/console I can do this however:

Entry.find(:first).image_relative_path
=> "1/testpic.jpg"
 >>

I think this might have todo with the way I am building @entry via a
find_by_sql:

     def self.mine
              find_by_sql("select entries.id,entries.image,
species.name, length,species.multiplier*length as score,caught_on
from entries join species on species_id = species.id order by score
DESC")

end

Any ideas what I am doing wrong?



- Bill
This topic is locked and can not be replied to.