New Default Files and Settings for Rails 7

New Default Files and Settings

config/cable.yml is now default
adapter: redis
url: redis://localhost:6379/1

adapter: test

adapter: redis
url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
channel_prefix: HGTest21_0926_production

Previously, Redis was not required to run the default Rails app, so technically this makes Rails depend on Redis. However, if you want to remove ActionCable you still switch these back to the Rails 6 defaults using:


Default it looks like this:

# Use direct uploads for Active Storage (remember to import "@rails/activestorage" in your application.js)
# pin "@rails/activestorage", to: "activestorage.esm.js"

# Use node modules from a JavaScript CDN by running ./bin/importmap

pin "application"
pin "@hotwired/turbo-rails", to: "turbo.js"
pin "@hotwired/stimulus", to: "stimulus.js"
pin "@hotwired/stimulus-importmap-autoloader", to: "stimulus-importmap-autoloader.js"
pin_all_from "app/javascript/controllers", under: "controllers"

The app/javascript/application.js file uses Turbo-Rails by default:
// Configure your import map in config/importmap.rb. Read more:
import "@hotwired/turbo-rails"
import "controllers"