couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Gross <pgr...@gmail.com>
Subject Re: ruby client
Date Wed, 31 Dec 2008 17:51:01 GMT

> qq, your choice of couch ruby client (and why)?

I use CouchRest (http://github.com/jchris/couchrest/tree/master) and 
have been very happy with it.  It has both a low-level API:

    response = @db.save({:key => 'value', 'another key' => 'another value'})
         doc = @db.get(response['id'])

and an ActiveRecord like model class:

    class Course < CouchRest::Model
       key_accessor :title
       cast :questions, :as => ['Question']
       cast :professor, :as => 'Person'
       view_by :title
       view_by :dept, :ducktype => true
    end

Paul Gross
http://www.pgrs.net


Mime
View raw message