Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion couchrest/index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@ title: CouchRest
no_comments: true
---

<p>More details coming soon...</p>
<p>
Couchrest is a low-level driver that allows to access data throught
HTTP requests.
**Need documentation on subsequent pages**
</p>

2 changes: 1 addition & 1 deletion index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 9 additions & 0 deletions model/designs.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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

45 changes: 44 additions & 1 deletion model/index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,57 @@ 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'
{% endhighlight %}

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:
Expand Down