react-rails(react-ujs) is a convenient and easy way to use react.js on ruby on rails projects.
Using this gem/npm combo, we can add react.js boiler plate structure and generate components easily.
gem 'webpacker'
gem 'react-rails'
$ bundle install
$ rails webpacker:install # OR (on rails version < 5.0) rake webpacker:install
$ rails webpacker:install:react # OR (on rails version < 5.0) rake webpacker:install:react
$ rails generate react:install
Running rails server with rails s, will compile react webpack as well.