fixed mime types for latest couchdb revision

This commit is contained in:
Chris Anderson 2008-05-19 13:55:55 -07:00
parent 4858ac0cba
commit fa0d970d31

View file

@ -13,16 +13,13 @@ class CouchRest
CouchRest.get "#{@root}/_all_docs"
end
def temp_view map, reduce = nil
if reduce
def temp_view map, reduce = nil, type = 'application/json'
funcs = {
:map => map,
:reduce => reduce
:type => type
}
else
funcs = map
end
JSON.parse(RestClient.post("#{@root}/_temp_view", JSON.unparse(funcs), {"Content-Type" => "text/javascript"}))
funcs[:reduce] = reduce if reduce
JSON.parse(RestClient.post("#{@root}/_temp_view", JSON.unparse(funcs), {"Content-Type" => type}))
end
def view name