https://github.com/woh/webpacker-example-app
Basic Rails App with React + Webpacker
https://github.com/woh/webpacker-example-app
rails react webpack webpacker
Last synced: 2 months ago
JSON representation
Basic Rails App with React + Webpacker
- Host: GitHub
- URL: https://github.com/woh/webpacker-example-app
- Owner: WoH
- Created: 2017-05-03T12:22:49.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-03T20:40:30.000Z (about 9 years ago)
- Last Synced: 2025-06-15T10:52:36.411Z (about 1 year ago)
- Topics: rails, react, webpack, webpacker
- Language: Ruby
- Size: 72.3 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# README
Demo showing a basic Rails 5.1.0 app with React using the webpacker gem.
Based on this [article](https://medium.com/statuscode/introducing-webpacker-7136d66cddfb) by @gauravtiwari
Steps:
1. run ```rails new webpacker-example-app --webpack=react```
* Alternative: run
1. ```rails new webpacker-example-app```
2. ```rails webpacker:install```
3. ```rails webpacker:install:react```
* Optional: run ```rails g controller pages index``` to create an index view for our hello_react component
3. run ```bin/webpack-dev-server``` to start webpack compilation
4. Add ```<%= javascript_pack_tag 'application'``` to application.html.erb
5. Add ```<%= javascript_pack_tag 'hello_react'``` to index.html.erb or any other page.
6. Go to localhost:3000/pages/index.html