I am trying to upload a file to a webmachine
resource using PUT. The idea is to update the template resource with a file_id
.
module App::Resources
class UpdateTemplateResource < 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
I have found examples to accept a json type request, but not multipart. The file is not saved in the server but converted and send to another service for storage.