Skip to content

cottonwoodcoding/webpack-rails-react-basic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

This example app was built using webpack-rails-react without any options passed. This is a simple Todo List App to demonstrate extracting your client to a React application.

Running Sample App

  1. git clone
  2. npm install && bundle install
  3. bundle exec rake db:create db:migrate
  4. foreman start

Steps taken

  1. Create a new rails app
rails new todo_app --skip-turbolinks
  1. add webpack-rails-react to your Gemfile
gem 'webpack-rails-react'
  1. create and migrate the database
bundle exec rails g webpack_rails_react:install
  1. generate the app
rails g webpack_rails_react:install
  1. enter y to npm install
  2. enter y to bundle install
  3. generate a controller
rails g controller home index --no-helper --no-assets
  1. change your routes file to root to your new controller
root 'home#index'
  1. app/views/home/index.html.erb add <div id="app"></div>
  2. You will find the react app in webpack/

About

Walkthrough for using the webpack-rails-react gem

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published