Problem with attachment_fu


i started to test attachment_fu, but i can’t get it to upload a file. See the error:

NoMethodError (undefined method content_type' for "/100_2261.jpg":String): /vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:244:in uploaded_data=’

I looked at the plugin code, but can’t figure out how to fix this issue. I’d appreciate any help.

Bye, Tino

Your form needs to be a multipart form. Use :multipart => true.

I use the following form snippet:

form_remote_for(:image, :url => images_path, :html => {:multipart => true} , :update => “image”) do |f|

And it is compiled to a multipart form as far as i see in my html code.

You can't use AJAX forms (form_remote_for uses a for file upload calls a XMLHttpRequest via the prototype js lib) with file uploads. Alternate methods for inline uploads utilize hidden forms.


He, now it’s working. Thank you Raja. For the first contact with attachment_fu I will avoid using AJAX forms for such a scenario.