Ok starting to loose my mind here. And since I am still learing rails
and ruby this is fast approaching the limit of my knowledge. I took a
stab out of frustration and opened up firefox to see if I was going
crazy or not and I got a new error. I am running rails on a mac using
the locomotive .14.3 max bundle. When I try to upload a file using
safari (Version 2.0.2 (416.13)) i noticed the following was in the
parameters dump when I tried to send a file.
Parameters: {“commit”=>“Update”, “multipart”=>“true”, “id”=>“296”,
“entry”=>{“image_temp”=>""}}
this finally jumped out at me. Where the heck is my image? I selected
one I know that for sure why is it not in the params list. The
crazier thing is that a temp directory is getting created where file-
column says it should however the directory is empty.
I received the following error:
undefined method `original_filename’ for
{“image_temp”=>""}:HashWithIndifferentAccess
After pulling my hair out I opened up firefox went to the page where
I upload a file. This time my error page looks like this:
undefined method `original_filename’ for {“image_temp”=>"",
“image”=>“5391.jpg”}:HashWithIndifferentAccess
and the parameters dump:
Parameters: {“commit”=>“Update”, “multipart”=>“true”, “id”=>“298”,
“entry”=>{“image_temp”=>"", “image”=>“5391.jpg”}}
This shows promise at least the image is showing up in the params
list. it seems either rails, or locomotive or file-column does not
like safari as the entry[image] is not getting passed to the
controller while firefox (1.0.7 as well as firefox 1.5) is at least
adding the image to my params list but is not liked all that much
either.
After digging around in the file_column.rb file that there are some
special cases for IE but on further review they seem to only swap
around slashes. This made me curious. I located a windows box in the
office and tried to upload a file. I did receive the same error on
firefox as I did with the mac version however on IE I received the
following:
undefined method `original_filename’ for #<HashWithIndifferentAccess:
0x22573b4>
with a params list of
Parameters: {“commit”=>“Update”, “multipart”=>“true”, “id”=>“301”,
“entry”=>{“image_temp”=>"", “image”=>“C:\Documents and Settings
\ryarrow\Desktop\image.jpg”}}
now I am new to rails so I took a look at what was special for IE and
it looks to me (correct me if I am wrong) that this code
filename = File.basename(filename.gsub("\", “/”)) # work-around for IE
is supposed to take those \ slashes and change them to a single /
On to the logs.
it seems no matter what browser I use I am getting the same stack
trace issue in file_column
/vendor/plugins/file_column/lib/file_column.rb:187:in store_upload' /vendor/plugins/file_column/lib/file_column.rb:118:in
upload’
/vendor/plugins/file_column/lib/file_column.rb:54:in assign' /vendor/plugins/file_column/lib/file_column.rb:584:in
image=’
/vendor/plugins/file_column/lib/file_column.rb:583:in `image=’
so I am at least seeing the plugin and trying to give it data. But I
can’t tell from the logs where it is falling apart on me.
Any thoughts?
Andrew