The Rails tutorial blog app using NoBrainer ODM for RethinkDB
Ruby HTML CSS CoffeeScript JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
config
lib
log
public
script
test
vendor
.gitignore
Gemfile
Gemfile.lock
README.md
Rakefile
config.ru

README.md

This is the Rails tutorial basic blog app ported to use NoBrainer ORM for RethinkDB.

Note: this sample app is still under development.

NoBrainer ORM for RethinkDB

In order to benefit of as much of the Rails-packaged goodies, we're using the NoBrainer ORM for RethinkDB.

Using NoBrainer instead of ActiveRecord is very easy:

class Post
  include NoBrainer::Document
  include NoBrainer::Document::Timestamps

  # Defines the fields of the document visible to the application
  field :author,  :type => String, :required => true
  field :title,   :type => String, :required => true
  field :content, :type => Text,   :min_length => 5

  # Defines a one-to-many relationship between +Post+ and +Comment+
  has_many :comments, :dependent => :destroy
end

See the two models defined by this sample app for more details: post.rb and comment.rb

Accessing the data

You can check out the two controllers posts_controller.rb and comments_controller.rb to see how using the model methods translates into RethinkDB's ReQL queries.