diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 43e904f..d08e795 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,4 +1,18 @@ { + "postAttachCommand": { + "server": "rails server", + }, + "portsAttributes": { + "3000": { + "label": "Application", + "onAutoForward": "openPreview" + } + }, + "customizations": { + "codespaces": { + "openFiles": ["config/routes.rb", "README.md"] + } + }, "extensions": [ "rebornix.Ruby" ], diff --git a/Gemfile.lock b/Gemfile.lock index 3d8a8ff..e8fec78 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -298,7 +298,7 @@ DEPENDENCIES webdrivers RUBY VERSION - ruby 3.0.3p157 + ruby 3.1.2p20 BUNDLED WITH 2.3.12 diff --git a/README.md b/README.md index 7db80e4..d9763d1 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,7 @@ -# README +# GitHub Codespaces ♥️ Ruby on Rails -This README would normally document whatever steps are necessary to get the -application up and running. +Welcome to your shiny new Codespace running Rails! We've got everything fired up and running for you to explore Rails. -Things you may want to cover: +You've got a blank canvas to work on from a git perspective as well. There's a single initial commit with the what you're seeing right now - where you go from here is up to you! -* Ruby version - -* System dependencies - -* Configuration - -* Database creation - -* Database initialization - -* How to run the test suite - -* Services (job queues, cache servers, search engines, etc.) - -* Deployment instructions - -* ... +Everything you do here is contained within this one codespace. There is no repository on GitHub yet. If and when you’re ready you can click "Publish to GitHub" and we’ll create your repository and push up your project. If you were just exploring then and have no further need for this code then you can simply delete your codespace and it's gone forever. diff --git a/config/environments/development.rb b/config/environments/development.rb index 8ca9e9b..bac3264 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -60,7 +60,7 @@ Rails.application.configure do config.assets.quiet = true config.action_dispatch.default_headers = { - 'X-Frame-Options' => 'ALLOW-FROM githubpreview.dev' + 'X-Frame-Options' => 'ALLOW-FROM preview.app.github.dev' } # Raises error for missing translations. @@ -71,4 +71,7 @@ Rails.application.configure do # Uncomment if you wish to allow Action Cable access from any origin. # config.action_cable.disable_request_forgery_protection = true + + # Allow requests from our preview domain. + config.hosts << "#{ENV['CODESPACE_NAME']}-3000.preview.app.github.dev" end