diff --git a/couchrest/index.markdown b/couchrest/index.markdown index 7f0d056..6e42896 100644 --- a/couchrest/index.markdown +++ b/couchrest/index.markdown @@ -4,5 +4,9 @@ title: CouchRest no_comments: true --- -
More details coming soon...
++ Couchrest is a low-level driver that allows to access data throught + HTTP requests. + **Need documentation on subsequent pages** +
diff --git a/index.markdown b/index.markdown index 06800dc..a03a597 100644 --- a/index.markdown +++ b/index.markdown @@ -10,7 +10,7 @@ CouchRest is composed of two libraries; [couchrest](/couchrest/index.html) a low To get started, you'll probably want to have a look at the [couchrest model introduction](/model/index.html). This will help you access CouchDB from your rails project and get you modeling in a few short steps. -*NOTE:* This documentation is based on the 1.1.0 release of couchrest and couchrest model made on the 25 of June 2011. +*NOTE:* This documentation is based on the 2.0 release of couchrest and 2.2.0 of couchrest model made on July and August 2016. ## Contributing diff --git a/model/designs.markdown b/model/designs.markdown index a646643..52c0039 100644 --- a/model/designs.markdown +++ b/model/designs.markdown @@ -7,4 +7,13 @@ id: model_desgins # Defining Designs +To create views there is a special method *design*, that allow to create view +to find models according to attributes. +Inside a Model definition, add these lines + + design do + view :by_name + end + +to create a view that get every model ordered by name diff --git a/model/index.markdown b/model/index.markdown index 3fd760f..ff16473 100644 --- a/model/index.markdown +++ b/model/index.markdown @@ -10,7 +10,20 @@ CouchRest Model adds additional functionality to the standard CouchRest Document ## Installation -Simply include the library in your Rails 3 (or 3.1) project's Gemfile: +### Rails 5 + +#### Gem + + $ sudo gem install couchrest_model + +#### Bundler + +Simply put the following line into your Gemfile + + gem 'couchrest_model' + +### Rails 3 +Simply include the library in your Rails 5 (or 3.1) project's Gemfile: {% highlight ruby %} gem :couchrest_model, '~> 1.2.0.beta' @@ -18,6 +31,36 @@ gem :couchrest_model, '~> 1.2.0.beta' After a quick `bundle install` you'll now be able to begin creating your CouchRest Models. For more details on configuring the database connection, see the [configuration section](/model/configuring.html). +## Configuration + +The library is looking for a file in *config/couchdb.yml*. You can generate it +by using the following command: + + $ rails generate couchrest_model:config + +It should looks like that: + + development: &development + protocol: 'http' + host: localhost + port: 5984 + prefix: your_prefix + suffix: development + username: your_username + password: your_password + test: + <<: *development + suffix: test + production: + protocol: 'https' + host: localhost + port: 5984 + prefix: your_prefix + suffix: production + username: root + password: 123 + + ## Generating Models Generate your first model: