File_column just will not work

Hello,

I have been trying for some time to get a file to upload using the
file_column plugin.

My code is here: Parked at Loopia

But my code is not the issue. I cannot even pass the unit test that
come with the file_column plugin.

If I run ruby file_column_test.rb i get:

  1. Error:
    test_store_dir_callback(FileColumnTest):
    TypeError: can’t convert Fixnum into String
    file_column_test.rb:204:in join' file_column_test.rb:204:in test_store_dir_callback’

If I run the rmagick tester file, I get 6 failures. Is it possible that
rmagick would keep file_column from functioning at all?

When I try to upload a file, it just passes null to the DB and doesn’t
even download the file to the /tmp folder.

Any suggestions would be great. I will be working on trying to see if
rmagick is working or not, but I doubt that would keep the file from
uploading at all.

Thanx for you time.

://
Nathan H.

On 04/08/06, Nathan H. [email protected] wrote:

  1. Error:
    test_store_dir_callback(FileColumnTest):
    TypeError: can’t convert Fixnum into String
    file_column_test.rb:204:in join' file_column_test.rb:204:in test_store_dir_callback’

I think it ought to read:
assert_equal_paths File.join(RAILS_ROOT, “public”, “my_store_dir”,
e.id.to_s),
e.image_dir
In lieu of
assert_equal_paths File.join(RAILS_ROOT, “public”, “my_store_dir”,
e.id),
e.image_dir

The svn diff is stored at
http://prolificprogrammer.com/~hdiwan/file_column.patch

On 2006-08-05 17:35:06 -0400, “Hasan D.”
[email protected] said:

I think it ought to read:
assert_equal_paths File.join(RAILS_ROOT, “public”, “my_store_dir”, e.id.to_s),
e.image_dir

Thanx for that. I now pass every test but one, actually uploading a
file. It never actually takes the file from my hard drive.

  1. Failure:
    test_with_image_tag(UrlForFileColumnTest)
    [file_column_helper_test.rb:80]:
    <“/foo/bar/entry/image/tmp/1154962075.100369.19508/skanthak.png?1154962075”>
    expected to be =~
    </^/foo/bar/entry/image/.+/skanthak.png$/>.

When I try to write my own rails app to upload a file, it doesn’t even
return a tmp directory…

I am going to have to roll my own now, but I really like the way
file_column handles uploads.

If anyone has any suggestions, thanx.

://
Nathan H.

On 2006-08-07 11:35:35 -0400, “Carl F.”
[email protected] said:

I have a feeling that it is as simple as your multipart isn’t working.

It’s one of those things isn’t it. I noticed that too and repaired it.
Thanx.

It wasn’t the only problem I had left. I had a bad install of image
magick and had to reinstall it, but I got er workin.

There needs to be a gem install all_the_crap_i_need_for_me :wink:

://
Nathan H.

I have a feeling that it is as simple as your multipart isn’t working.
Try this:

<%= start_form_tag({:action => ‘create’}, :multipart => true)%>

It seems dumb, but from the looks of your Firefox output, the
multipart is being passed as a parameter. Look at the actual HTML that
is being produced to verify that the form tag is being built properly.