Forum: Ruby on Rails file_column undefined method `data_relative_path'

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.
C7ad14bd6988bc623c3b351354b619c8?d=identicon&s=25 Jiajv Hh (jiajv_)
on 2007-06-02 20:17
i use file_column0.31 and  rmagick1.141
i often got the error "undefined method `data_relative_path' for
#<Photo:0x6da7568>" when the page display image.

i print some debug info ,when display natural:
in============================================url_for_file_column
object============================================#<Photo:0x6c9d0b4>
photo.data============================================./script/../config/../p

ubl
ic/photo/data/24/850A63B034A4FAB73.jpg
object.methods.grep(/method/)=====================data_just_uploaded?,data_op

tio
ns,data_relative_path,data_dir,data_relative_dir,data_temp,data_temp=,data,da

ta=
,data_magick_after_assign
method============================================data
subdir============================================thumb
relative_path==================24/thumb/850A63B034A4FAB73.jpg

and this is error
in============================================url_for_file_column
object============================================#<Photo:0x6d97938>
photo.data============================================850A63B034A4FAB73.jpg
object.methods.grep(/method/)=====================data?,data
method============================================data
subdir============================================thumb
i suppose the method "data_relative_path" cant be found.
version:
ruby 1.8.5 (2006-08-25) [i386-mswin32]
Rails 1.2.3

my sourcecode:

photo.rb
class Photo < ActiveRecord::Base
validates_format_of :data,
:with=>/^.*(.jpg|.JPG|.gif|.GIF)$/,
:message => "你只能上传JPG或则GIF的图片文件"
file_column :data, :magick => {
:versions => { "thumb" => "50x50>", "medium" => "640x480>" }
}

belongs_to:user
belongs_to:entry
end

 in **.rhtml
<%= image_tag url_for_file_column 'photo', 'data' %>


at rubyforge.com i found rmagick-1.14.1-win32.gem
and rmagick-1.15.6.gem ,iused
rmagick-1.14.1-win32.gem ;
and what is the difference???
This topic is locked and can not be replied to.