- $ bundle install
- $ yarn
- $ rails webpacker:install
- $ rails webpacker:install:react
- $ rails db:create
- $ rails db:migrate
- $ rails s
- $ \curl -sSL https://get.rvm.io | bash -s stable
- $ rvm install 2.7.0
- $ rvm --default use 2.7.0
- $ ruby -v
- $ rails db:drop
- $ rails db:create
- $ rails db:migrate
- sign up a test user
- $ rails db:seed
- $ rails new stockbyte_app -d postgresql -T
- $ cd apartment_app
- $ bundle add devise
- $ rails generate devise:install
- $ rails generate devise User
- $ rails generate devise:views
- $ rails db:create
- $ rails db:migrate
- $ bundle add react-rails
- $ bundle install
- $ rails webpacker:install
- $ rails webpacker:install:react
- $ rails generate react:install
- $ yarn install
- $ rails g react:component App
- $ rails g controller Home
- ./config/routes.rb
get '*path', to: 'home#root', constraints: ->(request){ request.format.html? }
root to: 'home#root'
- create root.html.erb in ./app/views/home
///variables and paths created by Devise, pass to App.js
<%= react_component("App", {
logged_in: user_signed_in?,
sign_in_route: new_user_session_path,
sign_out_route: destroy_user_session_path,
edit_user_route: edit_user_registration_path,
current_user: current_user
}) %>
- ./app/controllers/home_controller.rb
def root
end
- ./config/initializers/devise.rb
change
config.sign_out_via = :delete
toconfig.sign_out_via = :get
- ./app/javascript/component/App.js
create react component here
- $ npm install bootswatch
- $ yarn install --check-files
- add to app.js
import 'bootswatch/dist/litera/bootstrap.min.css'