file_column undefined method `data_relative_path''

Jiajv Hh
Sat, 02 Jun 2007 18:17:36 -0000

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???

--
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---