How to accept a PUT multipart file in webmachine-ruby
<p>I am trying to upload a file to a <code>webmachine</code> resource using PUT. The idea is to update the template resource with a <code>file_id</code>.</p>

<pre><code>module App::Resources
  class UpdateTemplateResource &lt; TemplateResource

    def allowed_methods
      %W(PUT)
    end

    def content_types_accepted
      # What to do here?
    end

    private

    def template_id
      request.path_info[:id]
    end

    def template
      @template ||= ::App::Models::Template.find_latest_version_by_guid(id)
    end
  end
end
</code></pre>

<p>I have found examples to accept a <a href="https://github.com/webmachine/webmachine-ruby/wiki/How-do-I-do-...-with-Webmachine%3F#return-a-201-from-a-put" rel="nofollow">json</a> type request, but not multipart. The file is not saved in the server but converted and send to another service for storage.</p>