How to submit multipart messages using ActiveResource?
I am trying send user profile images from a client to the server using ActiveResource. It looks like Active开发者_运维技巧Resource doesn't support multi-part.
Is there a gem/plugin that adds Multipart support to ActiveResource? Or any other alternative approach to addressing this issue.
The best way is not to use multipart, but to embed the file's binary content in your resource's XML, which then goes in the request body.
This is easy to do using ActiveResource
I've created a plugin to do that in Rails 3:
http://github.com/nragaz/encoded_attachment
精彩评论