Thanks to visit codestin.com
Credit goes to github.com

Skip to content

mrifat/reactive-record

 
 

Repository files navigation

Reactive Record

Join the chat at https://gitter.im/catprintlabs/reactive-record

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

"So simple its almost magic" (Amazed developer)

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

  • Fully integrated with React.rb (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 Hobo style model based permission mechanism for security.
  • 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 react.rb todo (live demo here.)

Head on over to https://gitter.im/zetachang/react.rb 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)
        begin
          file = Rails.root.join('app','models',"#{child_class.name.underscore}.rb").to_s rescue nil
          begin
            require file
          rescue LoadError
          end
          # from active record:
          child_class.initialize_find_by_cache
        rescue
        end # if File.exist?(Rails.root.join('app', 'view', 'models.rb'))
        super
      end
    end
  end
end

About

Ruby Opal + React + ActiveRecord = GOODNESS!

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
MIT-LICENSE

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 75.3%
  • Ruby 24.3%
  • Other 0.4%