In this exercise I've used the react-rails gem. This gem allows you to build React components as a part of your Rails JavaScript and serve it in a component, react_component, to be used in a regular ERB file.
- Implement a connection between a Ruby on Rails back-end and React front-end.
- Understand the pros and cons of different approaches of connecting Ruby on Rails back-end with React front-end.
To get a local copy for this project and running follow these simple example steps.
- You need to have git installed in your machine.
- Install a recent version of Postgres.
- Already install Rails
- Already insatll React
$ https://github.com/Alexr16/rails-react.git
$ cd rails-react
$ rails db:create
$ rails db:migrate
$ bundle install
$ yarn install
$ npm install
- You can now run:
$ rails s # or
$ rails server -p3000 # to visit http://localhost/
- To see React-Router working:
$ ./bin/webpack-dev-server # enables auto-webpacking
- You can now visit
http://localhost:3000
to view your new website!
👤 Jorge Rios
- GitHub: @Alexr16
- Twitter: @ReveloJ
- LinkedIn: Jorge Ríos
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
Give a ⭐️ if you like this project!
- Thanks to my peers who are always there to offer support.
This project is MIT licensed.