bundle intall to install that. Make sure that you have node and yarn installed around this time, so once that is done, you can run
rails webpacker:install. This is how you would install webpacker in any old rails app. There's also a --webpack option that you can use to have it installed by default in any new rails app as well, but we're just going to install it manually in this example. So
import GoRails from 'gorails'
gorails: true, so we could
console.log(Gorails), and if we save that, we can go back into the browser, and we see that
yar add vue vue-loader vue-template-compiler, and that actually goes and tells yarn to add that to you local packages.json so now our packages.json has vue, vue-loader, vue-template-compiler and that is added to that, so you can either use yarn to add dependencies, or you can use this file directly and edit it, and then run yarn to install it. So it's usually easier to run yarn add, and we'll go ahead and do that for you, so we now have this hello_vue.js which is the actual location that we want to insert into the browser so if we were to go back to our layout/application.html.erb, rather than doing our application.js as the include, we could do
Transcript written by Miguel
Join 22,346+ developers who get early access to new screencasts, articles, guides, updates, and more.