Ruby Opal + React + ActiveRecord = GOODNESS!
JavaScript Ruby Other
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Reactive Record

Join the chat at Code Climate Gem Version

reactive-record gives you active-record models on the client integrated with reactrb.

"So simple its almost magic" (Amazed developer)

NOTE: reactive-record >= 0.8.x depends on the reactrb gem. You must upgrade to reactrb

You do nothing to your current active-record models except move them to the models/public directory (so they are compiled on the client as well as the server.)

  • Fully integrated with Reactrb (which is React with a beautiful ruby dsl.)
  • Takes advantage of React prerendering, and afterwards additional data is lazy loaded as it is needed by the client.
  • Supports full CRUD access using standard Active Record features, including associations, aggregations, and errors.
  • Uses model based authorization mechanism for security similar to Hobo or Pundit.
  • Models and even methods within models can be selectively implemented "server-side" only.

There are no docs yet, but you may consider the test cases as a starting point, or have a look at reactrb todo (live demo here.)

For best results simply use the reactrb-rails-installer to install everything you need into a new or existing rails app.

Head on over to to ask any questions you might have!

Note: We have dropped suppport for the ability to load the same Class from two different files. If you need this functionality load the following code to your config/application.rb file.

module ::ActiveRecord
  module Core
    module ClassMethods
      def inherited(child_class)
          file = Rails.root.join('app','models',"#{}.rb").to_s rescue nil
            require file
          rescue LoadError
          # from active record:
        end # if File.exist?(Rails.root.join('app', 'view', 'models.rb'))