Ruby on Rails React with Rails using react-rails gem React installation for Rails using rails_react gem

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

Add react-rails to your Gemfile:

gem 'react-rails'

And install:

bundle install

Next, run the installation script:

rails g react:install

This will:

create a components.js manifest file and a app/assets/javascripts/components/ directory, where you will put your components place the following in your application.js:

//= require react
//= require react_ujs
//= require components


Got any Ruby on Rails Question?