Last active
September 3, 2018 13:16
-
-
Save oliveira-andre/ffb9367e1651e992dab9dfb40f76167a to your computer and use it in GitHub Desktop.
generate rails with (angular or vue or react) in webpacker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #type on terminal | |
| rails new angular-webpack-rails --webpack=angular | |
| #generate the home/index.html | |
| rails g controller home index | |
| #in routes add | |
| root to: 'home#index' | |
| #in layouts/application.html.erb add above yield | |
| <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %> | |
| #in javascripts/applications.js (that is not in assets) | |
| require('../hello-angular'); //you can change the name of /hello-angular to any other name but not forgete to change the file inside the javascript | |
| #in home/index.html.erb insert | |
| <hello-angular></hello-angular> | |
| #install the gem forema adding in your gemfie | |
| gem 'foreman' | |
| #create a Pocfile and add | |
| web: rails s | |
| webpacker: ./bin/webpack-dev-server | |
| #and the last but not least run in your terminal | |
| foreman start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment