/rails_jsonb_collections

Demo rails project demonstrating using JSONB fields to store collections of embedded models.

Primary LanguageRuby

Use JSONB fields as collections of embedded models

See complete guide in my blogpost: Store collections in JSONB field

Requirements

You need ruby 2.6.1 and PostgreSQL 11 installed. Older versions should work too but you'll have to update the Gemfile and .ruby-version files.

Setup

  • clone this repo
  • create the database with sample data: bundle exec rails db:setup
  • start server bundle exec rails s
  • browse to localhost:3000