#69 Ruby on Rails 5.1.0 Changes and New Features
SummaryUpcoming features include Yarn/Webpack, System Tests via Capybara, Encrypted Secrets and a bunch of other cool things!
rails beta 12:00
WIth system tests, using Capybara built in, you'll need to download the chromedriver
Ruby on Rails 5.1.0 Deprecations - https://blog.driftingruby.com/ruby-on-rails-5-1-0-deprecations/
# Installing yarn brew install node brew install yarn
# Terminal gem install rails --pre # For older versions, rails _5.0.1_ new testapp # To use webpack rails new testapp --webpack # or with a JS Framework rails new testapp --webpack=vue|angular|react # To install the JS Framework after creating the app rails webpacker:install:vue
To have compile the webpack assets, which will install to public/packs/folders
# Terminal rails webpacker:compile
# Terminal brew install chromedriver rails g system_test WelcomeController
# welcome_controllers_test.rb require "application_system_test_case" class WelcomeControllersTest < ApplicationSystemTestCase test "visiting the index" do visit root_url accept_alert('Webpacker') assert_selector "h1", text: "Welcome" end end
# config/environments/development.rb config.x.webpacker[:dev_server_host] = "http://localhost:8080"
Start webpack-dev-server to serve the assets with webpack. Keep in mind that you will also need the Rails server running as well.
# Terminal ./bin/webpack-dev-server
Adding a JS Library to the application via yarn and webpack
# Terminal yarn add jquery
# application.js //= require jquery/dist/jquery