This is a simple demo of how to integrate
Ruby on Rails
andReact
- Ruby on Rails
- React
- Git
To get a local copy up and running follow these simple example steps.
- computer
-
Run git clone
https://github.com/jheart-vic/Hello-React-Rails
-
Run
cd Hello-React-Rails
-
Run
bundle install
-
Run
npm i
-
Run
npm run build
(having issues building the app Runnpm install --save-dev webpack webpack-cli
) -
Run
rails server
-
Note Make sure to have the database as postgres and change the password to your database password
-
rails new -j webpack my_new_rails_app
-
RunTo add it to an existing rails app:
-
Add jsbundling-rails to your Gemfile with gem 'jsbundling-rails' if it's not there
-
Run ./bin/bundle install
-
Run ./bin/rails javascript:install:webpack
-
To Install needed node dependencies
-
yarn add react react-dom or npm install react react-dom
-
yarn add @babel/core @babel/preset-env @babel/preset-react babel-loader --dev or npm install @babel/core @babel/preset-env @babel/preset-react babel-loader --dev
👤 Victor Akabueze
- Linkedin victor-David
- Twitter victor-David
- Github: @Victor-David
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
Give a ⭐️ if you like this project!
- Hat tip to anyone whose code was used
- Inspiration
- etc
This project is MIT licensed.