React-Rails Demo Application
August 27, 2023 ยท View on GitHub
This repo is an example of a simple working Rails 7, Shakapacker 7, React-Rails 3 application.
Where generators are used, the git commit will be the command run to get to the current application state so it will hopefully be easy to follow along at home.
For migration to react_on_rails, please read the migration guide.
How to test the Demo Application
1) Install the JS packages:
yarn install # or npm install
2) Install GEM packages:
bundle install
3) In one terminal run the rails server:
rails s
4) In another terminal run the webpack server:
./bin/webpack-dev-server
5) Visit the welcome page
Branches
This repo contains two trees, one Webpacker and one Sprockets.
Each branch illustrates a react-rails ability.
master-> Webpacker 3- react-rails-to-react-on-rails -> An example of migration from
react-railsv3 toreact_on_railsv13.4. sprockets-> Sprockets 3rails-production-version-> Sprockets 3 + serving production prebundled reactrails-assets-sprockets-> Sprockets 3 + using Rails-Assets.org (failed)generate-new-component-> Webpacker 3 + new style componentwithout-ujs-> Sprockets 3 + removing UJS and making component globally accessiblejsx-file-example-> Webpacker 3 + file named .JSXcoffeescript-example-> Webpacker 3 + Coffeescript WITH JSX