├── .devcontainer ├── devcontainer.json └── icon.svg ├── .gitattributes ├── .gitignore ├── .irbrc ├── .solargraph.yml ├── .vscode └── settings.json ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── README.md ├── Rakefile ├── app ├── assets │ ├── config │ │ └── manifest.js │ ├── images │ │ └── .keep │ └── stylesheets │ │ ├── application.css │ │ └── hello.css ├── channels │ └── application_cable │ │ ├── channel.rb │ │ └── connection.rb ├── controllers │ ├── application_controller.rb │ ├── concerns │ │ └── .keep │ └── hello_controller.rb ├── helpers │ ├── application_helper.rb │ └── hello_codespaces_helper.rb ├── javascript │ ├── application.js │ └── controllers │ │ ├── application.js │ │ ├── hello_controller.js │ │ └── index.js ├── jobs │ └── application_job.rb ├── mailers │ └── application_mailer.rb ├── models │ ├── application_record.rb │ └── concerns │ │ └── .keep └── views │ ├── hello │ └── index.html.erb │ └── layouts │ ├── application.html.erb │ ├── mailer.html.erb │ └── mailer.text.erb ├── bin ├── bundle ├── importmap ├── rails ├── rake └── setup ├── config.ru ├── config ├── application.rb ├── boot.rb ├── cable.yml ├── credentials.yml.enc ├── database.yml ├── environment.rb ├── environments │ ├── development.rb │ ├── production.rb │ └── test.rb ├── importmap.rb ├── initializers │ ├── assets.rb │ ├── content_security_policy.rb │ ├── filter_parameter_logging.rb │ ├── inflections.rb │ └── permissions_policy.rb ├── locales │ └── en.yml ├── puma.rb ├── routes.rb └── storage.yml ├── db └── seeds.rb ├── lib ├── assets │ └── .keep └── tasks │ └── .keep ├── log └── .keep ├── public ├── 404.html ├── 422.html ├── 500.html ├── apple-touch-icon-precomposed.png ├── apple-touch-icon.png ├── favicon.ico ├── railstutorial.png └── robots.txt ├── storage └── .keep ├── test ├── application_system_test_case.rb ├── channels │ └── application_cable │ │ └── connection_test.rb ├── controllers │ ├── .keep │ └── hello_codespaces_controller_test.rb ├── fixtures │ └── files │ │ └── .keep ├── helpers │ └── .keep ├── integration │ └── .keep ├── mailers │ └── .keep ├── models │ └── .keep ├── system │ └── .keep └── test_helper.rb ├── tmp ├── .keep ├── pids │ └── .keep └── storage │ └── .keep └── vendor ├── .keep └── javascript └── .keep /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // Specifications: https://containers.dev/implementors/json_reference/ 2 | // Format details: https://aka.ms/devcontainer.json 3 | // Config options: https://github.com/microsoft/vscode-dev-containers/tree/main/containers/ruby 4 | { 5 | "name": "railstutorial", 6 | 7 | // Universal is well-customized image for Codespaces: 8 | // https://hub.docker.com/_/microsoft-devcontainers-universal 9 | //"image": "mcr.microsoft.com/devcontainers/universal:2", 10 | //"features": { 11 | // "ghcr.io/devcontainers/features/ruby:1": {} 12 | //}, 13 | 14 | // Use Ruby image if you want to pin Ruby version like '3.2' 15 | // https://github.com/devcontainers/images/tree/main/src/ruby 16 | "image": "mcr.microsoft.com/devcontainers/ruby:3.2", 17 | //"workspaceFolder": "/railstutorial", => Container build failed 18 | 19 | // Enable learners to choose an affordable spec, starting at minimum one. 20 | //"hostRequirements": { 21 | // "cpus": 2, 22 | // "memory": "4gb", 23 | // "storage": "32gb" 24 | //}, 25 | 26 | "waitFor": "onCreateCommand", 27 | //"onCreateCommand": "", 28 | "onCreateCommand": "gem install solargraph -v '0.53.4' -N", 29 | //"onCreateCommand": "gem install solargraph -v '0.50.0' -N && gem install ruby-lsp -N", 30 | //"onCreateCommand": "gem install ruby-lsp -N", 31 | //# => Solargraph gem not found. Run `gem install solargraph` or update your Gemfile. 32 | "updateContentCommand": "bundle install", 33 | "postCreateCommand": "", 34 | "postAttachCommand": { 35 | "server": "rails server" 36 | }, 37 | "customizations": { 38 | "codespaces": { 39 | "openFiles": [ 40 | "app/views/hello/index.html.erb" 41 | ] 42 | }, 43 | "vscode": { 44 | "extensions": [ 45 | "GitHub.codespaces", 46 | "Shopify.ruby-lsp", // https://github.com/Shopify/ruby-lsp 47 | "castwide.solargraph" // https://github.com/castwide/vscode-solargraph 48 | //"rebornix.Ruby", // https://github.com/rubyide/vscode-ruby (Deprecated) 49 | 50 | ], 51 | "settings": { 52 | // General settings for Codespaces (VS Code) 53 | //"ruby.useLanguageServer": true , 54 | //"ruby.format": "rubocop", 55 | //"ruby.lint": { "rubocop": true }, 56 | //"ruby.intellisense": "rubyLocate", 57 | "editor.tabSize": 2, 58 | "editor.formatOnSave": false, // Disable onSave to show diff edited by learners only 59 | "editor.formatOnType": false, // Disable onType for the same reason above 60 | "editor.insertSpaces": true, // Use spaces, not tabs, to avoid errors for learners 61 | "editor.renderWhitespace": "none", 62 | "[ruby]": { 63 | "editor.defaultFormatter": "castwide.solargraph", 64 | "editor.semanticHighlighting.enabled": true // Enable semantic highlighting 65 | }, 66 | "files.associations": { "*.erb": "erb" }, 67 | "emmet.includeLanguages": { "erb": "html" }, 68 | 69 | // Settings for Solargraph 70 | // https://github.com/castwide/solargraph 71 | "solargraph.useBundler": false, 72 | "solargraph.diagnostics": false, 73 | "solargraph.formatting": true, // Use Ctrl+Shift+P->Format to format 74 | "solargraph.autoformat": false, 75 | "solargraph.definitions": true, 76 | "solargraph.completion": true, 77 | "solargraph.references": true, 78 | "solargraph.symbols": true, 79 | "solargraph.rename": true, 80 | "solargraph.hover": true, 81 | 82 | // Settings for Ruby LSP 83 | // https://github.com/Shopify/ruby-lsp 84 | "rubyLsp.rubyVersionManager": { 85 | "identifier": "none" 86 | }, 87 | "rubyLsp.formatter": "none", 88 | "rubyLsp.enabledFeatures": { 89 | "diagnostics": false, 90 | "formatting": false 91 | } 92 | } 93 | } 94 | }, 95 | "remoteEnv": { 96 | "EDITOR": "code --wait" 97 | }, 98 | "portsAttributes": { 99 | "3000": { 100 | "label": "Application", 101 | "onAutoForward": "openPreview" 102 | } 103 | }, 104 | "forwardPorts": [3000] 105 | } 106 | -------------------------------------------------------------------------------- /.devcontainer/icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # See https://git-scm.com/docs/gitattributes for more about git attribute files. 2 | 3 | # Mark the database schema as having been generated. 4 | db/schema.rb linguist-generated 5 | 6 | # Mark any vendored files as having been vendored. 7 | vendor/* linguist-vendored 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile '~/.gitignore_global' 6 | 7 | # Ignore bundler config. 8 | /.bundle 9 | 10 | # Ignore the default SQLite database. 11 | /db/*.sqlite3 12 | /db/*.sqlite3-* 13 | 14 | # Ignore all logfiles and tempfiles. 15 | /log/* 16 | /tmp/* 17 | !/log/.keep 18 | !/tmp/.keep 19 | 20 | # Ignore pidfiles, but keep the directory. 21 | /tmp/pids/* 22 | !/tmp/pids/ 23 | !/tmp/pids/.keep 24 | 25 | # Ignore uploaded files in development. 26 | /storage/* 27 | !/storage/.keep 28 | /tmp/storage/* 29 | !/tmp/storage/ 30 | !/tmp/storage/.keep 31 | 32 | /public/assets 33 | 34 | # Ignore master key for decrypting credentials and more. 35 | /config/master.key 36 | 37 | # Ignore history file used by IRB for interactive Ruby. 38 | .irb_history 39 | 40 | dump.rdb 41 | -------------------------------------------------------------------------------- /.irbrc: -------------------------------------------------------------------------------- 1 | IRB.conf[:COMPLETOR] = :type # default is :regexp 2 | -------------------------------------------------------------------------------- /.solargraph.yml: -------------------------------------------------------------------------------- 1 | --- 2 | include: 3 | - "**/*.rb" 4 | exclude: 5 | - spec/**/* 6 | - test/**/* 7 | - vendor/**/* 8 | - ".bundle/**/*" 9 | require: 10 | - actioncable 11 | - actionmailer 12 | - actionpack 13 | - actionview 14 | - activejob 15 | - activemodel 16 | - activerecord 17 | - activestorage 18 | - activesupport 19 | domains: [] 20 | reporters: 21 | - rubocop 22 | - require_not_found 23 | - typecheck 24 | formatter: 25 | rubocop: 26 | cops: safe 27 | except: [] 28 | only: [] 29 | extra_args: [] 30 | require_paths: [] 31 | plugins: [] 32 | max_files: 5000 33 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.minimap.enabled": false 3 | } 4 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | git_source(:github) { |repo| "https://github.com/#{repo}.git" } 3 | 4 | ruby "3.2.8" 5 | 6 | gem "rails", "7.0.4.3" 7 | gem "sassc-rails", "2.1.2" 8 | gem "sprockets-rails", "3.4.2" 9 | gem "importmap-rails", "1.1.5" 10 | gem "turbo-rails", "1.4.0" 11 | gem "stimulus-rails", "1.2.1" 12 | gem "jbuilder", "2.11.5" 13 | gem "puma", "5.6.8" 14 | gem "bootsnap", "1.16.0", require: false 15 | gem "sqlite3", "1.6.1" 16 | gem "concurrent-ruby", "1.3.4" 17 | 18 | group :development, :test do 19 | gem 'reline', '0.5.10' 20 | gem "debug", "1.7.1", platforms: %i[ mri mingw x64_mingw ] 21 | end 22 | 23 | group :development do 24 | gem "web-console", "4.2.0" 25 | gem "solargraph", "0.53.4" 26 | gem "irb", "1.10.0" 27 | gem "repl_type_completor", "0.1.2" 28 | end 29 | 30 | group :test do 31 | gem "capybara", "3.38.0" 32 | gem "selenium-webdriver", "4.8.3" 33 | gem "webdrivers", "5.2.0" 34 | gem "rails-controller-testing", "1.0.5" 35 | gem "minitest", "5.18.0" 36 | gem "minitest-reporters", "1.6.0" 37 | gem "guard", "2.18.0" 38 | gem "guard-minitest", "2.4.6" 39 | end 40 | 41 | # Windows ではタイムゾーン情報用の tzinfo-data gem を含める必要があります 42 | # gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ] 43 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | actioncable (7.0.4.3) 5 | actionpack (= 7.0.4.3) 6 | activesupport (= 7.0.4.3) 7 | nio4r (~> 2.0) 8 | websocket-driver (>= 0.6.1) 9 | actionmailbox (7.0.4.3) 10 | actionpack (= 7.0.4.3) 11 | activejob (= 7.0.4.3) 12 | activerecord (= 7.0.4.3) 13 | activestorage (= 7.0.4.3) 14 | activesupport (= 7.0.4.3) 15 | mail (>= 2.7.1) 16 | net-imap 17 | net-pop 18 | net-smtp 19 | actionmailer (7.0.4.3) 20 | actionpack (= 7.0.4.3) 21 | actionview (= 7.0.4.3) 22 | activejob (= 7.0.4.3) 23 | activesupport (= 7.0.4.3) 24 | mail (~> 2.5, >= 2.5.4) 25 | net-imap 26 | net-pop 27 | net-smtp 28 | rails-dom-testing (~> 2.0) 29 | actionpack (7.0.4.3) 30 | actionview (= 7.0.4.3) 31 | activesupport (= 7.0.4.3) 32 | rack (~> 2.0, >= 2.2.0) 33 | rack-test (>= 0.6.3) 34 | rails-dom-testing (~> 2.0) 35 | rails-html-sanitizer (~> 1.0, >= 1.2.0) 36 | actiontext (7.0.4.3) 37 | actionpack (= 7.0.4.3) 38 | activerecord (= 7.0.4.3) 39 | activestorage (= 7.0.4.3) 40 | activesupport (= 7.0.4.3) 41 | globalid (>= 0.6.0) 42 | nokogiri (>= 1.8.5) 43 | actionview (7.0.4.3) 44 | activesupport (= 7.0.4.3) 45 | builder (~> 3.1) 46 | erubi (~> 1.4) 47 | rails-dom-testing (~> 2.0) 48 | rails-html-sanitizer (~> 1.1, >= 1.2.0) 49 | activejob (7.0.4.3) 50 | activesupport (= 7.0.4.3) 51 | globalid (>= 0.3.6) 52 | activemodel (7.0.4.3) 53 | activesupport (= 7.0.4.3) 54 | activerecord (7.0.4.3) 55 | activemodel (= 7.0.4.3) 56 | activesupport (= 7.0.4.3) 57 | activestorage (7.0.4.3) 58 | actionpack (= 7.0.4.3) 59 | activejob (= 7.0.4.3) 60 | activerecord (= 7.0.4.3) 61 | activesupport (= 7.0.4.3) 62 | marcel (~> 1.0) 63 | mini_mime (>= 1.1.0) 64 | activesupport (7.0.4.3) 65 | concurrent-ruby (~> 1.0, >= 1.0.2) 66 | i18n (>= 1.6, < 2) 67 | minitest (>= 5.1) 68 | tzinfo (~> 2.0) 69 | addressable (2.8.7) 70 | public_suffix (>= 2.0.2, < 7.0) 71 | ansi (1.5.0) 72 | ast (2.4.3) 73 | backport (1.2.0) 74 | base64 (0.2.0) 75 | benchmark (0.4.0) 76 | bindex (0.8.1) 77 | bootsnap (1.16.0) 78 | msgpack (~> 1.2) 79 | builder (3.3.0) 80 | capybara (3.38.0) 81 | addressable 82 | matrix 83 | mini_mime (>= 0.1.3) 84 | nokogiri (~> 1.8) 85 | rack (>= 1.6.0) 86 | rack-test (>= 0.6.3) 87 | regexp_parser (>= 1.5, < 3.0) 88 | xpath (~> 3.2) 89 | coderay (1.1.3) 90 | concurrent-ruby (1.3.4) 91 | crass (1.0.6) 92 | date (3.4.1) 93 | debug (1.7.1) 94 | irb (>= 1.5.0) 95 | reline (>= 0.3.1) 96 | diff-lcs (1.6.1) 97 | erubi (1.13.1) 98 | ffi (1.17.1-aarch64-linux-gnu) 99 | ffi (1.17.1-arm64-darwin) 100 | ffi (1.17.1-x86_64-darwin) 101 | ffi (1.17.1-x86_64-linux-gnu) 102 | formatador (1.1.0) 103 | globalid (1.2.1) 104 | activesupport (>= 6.1) 105 | guard (2.18.0) 106 | formatador (>= 0.2.4) 107 | listen (>= 2.7, < 4.0) 108 | lumberjack (>= 1.0.12, < 2.0) 109 | nenv (~> 0.1) 110 | notiffany (~> 0.0) 111 | pry (>= 0.13.0) 112 | shellany (~> 0.0) 113 | thor (>= 0.18.1) 114 | guard-compat (1.2.1) 115 | guard-minitest (2.4.6) 116 | guard-compat (~> 1.2) 117 | minitest (>= 3.0) 118 | i18n (1.14.7) 119 | concurrent-ruby (~> 1.0) 120 | importmap-rails (1.1.5) 121 | actionpack (>= 6.0.0) 122 | railties (>= 6.0.0) 123 | io-console (0.8.0) 124 | irb (1.10.0) 125 | rdoc 126 | reline (>= 0.3.8) 127 | jaro_winkler (1.6.0) 128 | jbuilder (2.11.5) 129 | actionview (>= 5.0.0) 130 | activesupport (>= 5.0.0) 131 | json (2.10.2) 132 | kramdown (2.5.1) 133 | rexml (>= 3.3.9) 134 | kramdown-parser-gfm (1.1.0) 135 | kramdown (~> 2.0) 136 | language_server-protocol (3.17.0.4) 137 | lint_roller (1.1.0) 138 | listen (3.9.0) 139 | rb-fsevent (~> 0.10, >= 0.10.3) 140 | rb-inotify (~> 0.9, >= 0.9.10) 141 | logger (1.6.6) 142 | loofah (2.24.0) 143 | crass (~> 1.0.2) 144 | nokogiri (>= 1.12.0) 145 | lumberjack (1.2.10) 146 | mail (2.8.1) 147 | mini_mime (>= 0.1.1) 148 | net-imap 149 | net-pop 150 | net-smtp 151 | marcel (1.0.4) 152 | matrix (0.4.2) 153 | method_source (1.1.0) 154 | mini_mime (1.1.5) 155 | minitest (5.18.0) 156 | minitest-reporters (1.6.0) 157 | ansi 158 | builder 159 | minitest (>= 5.0) 160 | ruby-progressbar 161 | msgpack (1.8.0) 162 | nenv (0.3.0) 163 | net-imap (0.5.6) 164 | date 165 | net-protocol 166 | net-pop (0.1.2) 167 | net-protocol 168 | net-protocol (0.2.2) 169 | timeout 170 | net-smtp (0.5.1) 171 | net-protocol 172 | nio4r (2.7.4) 173 | nokogiri (1.18.5-aarch64-linux-gnu) 174 | racc (~> 1.4) 175 | nokogiri (1.18.5-arm64-darwin) 176 | racc (~> 1.4) 177 | nokogiri (1.18.5-x86_64-darwin) 178 | racc (~> 1.4) 179 | nokogiri (1.18.5-x86_64-linux-gnu) 180 | racc (~> 1.4) 181 | notiffany (0.1.3) 182 | nenv (~> 0.1) 183 | shellany (~> 0.0) 184 | observer (0.1.2) 185 | ostruct (0.6.1) 186 | parallel (1.26.3) 187 | parser (3.3.7.4) 188 | ast (~> 2.4.1) 189 | racc 190 | prism (0.19.0) 191 | pry (0.15.2) 192 | coderay (~> 1.1) 193 | method_source (~> 1.0) 194 | psych (5.2.3) 195 | date 196 | stringio 197 | public_suffix (6.0.1) 198 | puma (5.6.8) 199 | nio4r (~> 2.0) 200 | racc (1.8.1) 201 | rack (2.2.13) 202 | rack-test (2.2.0) 203 | rack (>= 1.3) 204 | rails (7.0.4.3) 205 | actioncable (= 7.0.4.3) 206 | actionmailbox (= 7.0.4.3) 207 | actionmailer (= 7.0.4.3) 208 | actionpack (= 7.0.4.3) 209 | actiontext (= 7.0.4.3) 210 | actionview (= 7.0.4.3) 211 | activejob (= 7.0.4.3) 212 | activemodel (= 7.0.4.3) 213 | activerecord (= 7.0.4.3) 214 | activestorage (= 7.0.4.3) 215 | activesupport (= 7.0.4.3) 216 | bundler (>= 1.15.0) 217 | railties (= 7.0.4.3) 218 | rails-controller-testing (1.0.5) 219 | actionpack (>= 5.0.1.rc1) 220 | actionview (>= 5.0.1.rc1) 221 | activesupport (>= 5.0.1.rc1) 222 | rails-dom-testing (2.2.0) 223 | activesupport (>= 5.0.0) 224 | minitest 225 | nokogiri (>= 1.6) 226 | rails-html-sanitizer (1.6.2) 227 | loofah (~> 2.21) 228 | nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) 229 | railties (7.0.4.3) 230 | actionpack (= 7.0.4.3) 231 | activesupport (= 7.0.4.3) 232 | method_source 233 | rake (>= 12.2) 234 | thor (~> 1.0) 235 | zeitwerk (~> 2.5) 236 | rainbow (3.1.1) 237 | rake (13.2.1) 238 | rb-fsevent (0.11.2) 239 | rb-inotify (0.11.1) 240 | ffi (~> 1.0) 241 | rbs (3.9.0) 242 | logger 243 | rdoc (6.12.0) 244 | psych (>= 4.0.0) 245 | regexp_parser (2.10.0) 246 | reline (0.5.10) 247 | io-console (~> 0.5) 248 | repl_type_completor (0.1.2) 249 | prism (>= 0.19.0, < 0.20.0) 250 | rbs (>= 2.7.0, < 4.0.0) 251 | reverse_markdown (3.0.0) 252 | nokogiri 253 | rexml (3.4.1) 254 | rubocop (1.74.0) 255 | json (~> 2.3) 256 | language_server-protocol (~> 3.17.0.2) 257 | lint_roller (~> 1.1.0) 258 | parallel (~> 1.10) 259 | parser (>= 3.3.0.2) 260 | rainbow (>= 2.2.2, < 4.0) 261 | regexp_parser (>= 2.9.3, < 3.0) 262 | rubocop-ast (>= 1.38.0, < 2.0) 263 | ruby-progressbar (~> 1.7) 264 | unicode-display_width (>= 2.4.0, < 4.0) 265 | rubocop-ast (1.42.0) 266 | parser (>= 3.3.7.2) 267 | ruby-progressbar (1.13.0) 268 | rubyzip (2.4.1) 269 | sassc (2.4.0) 270 | ffi (~> 1.9) 271 | sassc-rails (2.1.2) 272 | railties (>= 4.0.0) 273 | sassc (>= 2.0) 274 | sprockets (> 3.0) 275 | sprockets-rails 276 | tilt 277 | selenium-webdriver (4.8.3) 278 | rexml (~> 3.2, >= 3.2.5) 279 | rubyzip (>= 1.2.2, < 3.0) 280 | websocket (~> 1.0) 281 | shellany (0.0.1) 282 | solargraph (0.53.4) 283 | backport (~> 1.2) 284 | benchmark 285 | bundler (~> 2.0) 286 | diff-lcs (~> 1.4) 287 | jaro_winkler (~> 1.6) 288 | kramdown (~> 2.3) 289 | kramdown-parser-gfm (~> 1.1) 290 | logger (~> 1.6) 291 | observer (~> 0.1) 292 | ostruct (~> 0.6) 293 | parser (~> 3.0) 294 | rbs (~> 3.3) 295 | reverse_markdown (>= 2.0, < 4) 296 | rubocop (~> 1.38) 297 | thor (~> 1.0) 298 | tilt (~> 2.0) 299 | yard (~> 0.9, >= 0.9.24) 300 | yard-solargraph (~> 0.1) 301 | sprockets (4.2.1) 302 | concurrent-ruby (~> 1.0) 303 | rack (>= 2.2.4, < 4) 304 | sprockets-rails (3.4.2) 305 | actionpack (>= 5.2) 306 | activesupport (>= 5.2) 307 | sprockets (>= 3.0.0) 308 | sqlite3 (1.6.1-aarch64-linux) 309 | sqlite3 (1.6.1-arm64-darwin) 310 | sqlite3 (1.6.1-x86_64-darwin) 311 | sqlite3 (1.6.1-x86_64-linux) 312 | stimulus-rails (1.2.1) 313 | railties (>= 6.0.0) 314 | stringio (3.1.5) 315 | thor (1.3.2) 316 | tilt (2.6.0) 317 | timeout (0.4.3) 318 | turbo-rails (1.4.0) 319 | actionpack (>= 6.0.0) 320 | activejob (>= 6.0.0) 321 | railties (>= 6.0.0) 322 | tzinfo (2.0.6) 323 | concurrent-ruby (~> 1.0) 324 | unicode-display_width (3.1.4) 325 | unicode-emoji (~> 4.0, >= 4.0.4) 326 | unicode-emoji (4.0.4) 327 | web-console (4.2.0) 328 | actionview (>= 6.0.0) 329 | activemodel (>= 6.0.0) 330 | bindex (>= 0.4.0) 331 | railties (>= 6.0.0) 332 | webdrivers (5.2.0) 333 | nokogiri (~> 1.6) 334 | rubyzip (>= 1.3.0) 335 | selenium-webdriver (~> 4.0) 336 | websocket (1.2.11) 337 | websocket-driver (0.7.7) 338 | base64 339 | websocket-extensions (>= 0.1.0) 340 | websocket-extensions (0.1.5) 341 | xpath (3.2.0) 342 | nokogiri (~> 1.8) 343 | yard (0.9.37) 344 | yard-solargraph (0.1.0) 345 | yard (~> 0.9) 346 | zeitwerk (2.7.2) 347 | 348 | PLATFORMS 349 | aarch64-linux 350 | arm64-darwin-21 351 | x86_64-darwin-21 352 | x86_64-linux 353 | 354 | DEPENDENCIES 355 | bootsnap (= 1.16.0) 356 | capybara (= 3.38.0) 357 | concurrent-ruby (= 1.3.4) 358 | debug (= 1.7.1) 359 | guard (= 2.18.0) 360 | guard-minitest (= 2.4.6) 361 | importmap-rails (= 1.1.5) 362 | irb (= 1.10.0) 363 | jbuilder (= 2.11.5) 364 | minitest (= 5.18.0) 365 | minitest-reporters (= 1.6.0) 366 | puma (= 5.6.8) 367 | rails (= 7.0.4.3) 368 | rails-controller-testing (= 1.0.5) 369 | reline (= 0.5.10) 370 | repl_type_completor (= 0.1.2) 371 | sassc-rails (= 2.1.2) 372 | selenium-webdriver (= 4.8.3) 373 | solargraph (= 0.53.4) 374 | sprockets-rails (= 3.4.2) 375 | sqlite3 (= 1.6.1) 376 | stimulus-rails (= 1.2.1) 377 | turbo-rails (= 1.4.0) 378 | web-console (= 4.2.0) 379 | webdrivers (= 5.2.0) 380 | 381 | RUBY VERSION 382 | ruby 3.2.8p263 383 | 384 | BUNDLED WITH 385 | 2.5.6 386 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 GitHub & 2023 YassLab 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Codespaces ♥️ Railsチュートリアル 2 | 3 | 本リポジトリは[Railsチュートリアル](https://railstutorial.jp/)の [GitHub Codespaces](https://github.co.jp/features/codespaces) 用テンプレートです。2022年11月に公開された[GitHub公式のRailsテンプレート](https://github.com/github/codespaces-rails)を、[Railsチュートリアル](https://railstutorial.jp)用にカスタマイズしたものです。 4 | 5 | - [:computer: GitHub Codespaces 対応!環境構築が不要に(解説動画付き) - note](https://note.com/yasslab/n/n427c56266295) 6 | - [:newspaper: GitHub Codespaces が全ユーザーに無料提供へ、毎月60時間分 - Publickey](https://www.publickey1.jp/blog/22/github_codespaces60jetbrainsjupyterlabide.html) 7 | 8 |
9 | 10 | 本テンプレートは、Railsチュートリアルの第1章・第2章・第3章の冒頭にある `rails new` および `Gemfile` の更新まで(難しいとされる「環境構築」まで)が完了している状態となっており、**rails server が立ち上げられる状態から学習をスタートできます** 📝✨ 11 | 12 | ![Codespaces のサンプル画面](https://i.gyazo.com/b3af38fd1f8b2824791da9001a2bf6a0.png) 13 | 14 | 15 | 16 |
17 | 18 | ## 必要なもの 19 | 20 | - [Chrome](https://www.google.com/intl/ja/chrome/browser/) などのブラウザ(Chrome だとより快適に動作します) 21 | - [GitHub](https://github.co.jp/) のアカウント(もしまだであれば事前に作成しておきましょう) 22 | [![GitHub Top](https://i.gyazo.com/b5bad7bc8318837b67def1643a52b955.png)](https://github.co.jp/) 23 | 24 |
25 | 26 | ## Codespaces 使い方 27 | 28 | 以下の手順で、Codespaces を利用した環境構築が行えます 🛠 29 | 30 | 1. 当ページの上部にある `Use this template` から `Create a new repository` をクリックします。もし `Use this template` が表示されない場合は、ブラウザの横幅を広げてみましょう。 31 | ![本リポジトリからリポジトリを作成する場面](https://i.gyazo.com/a483f77e8299ea6b5dd75795c793fb8b.png) 32 | 33 | 1. 移動したページで、`Repository name` に作成するアプリ名、`Description` にアプリの説明文を入力し、`Private` を選択してリポジトリを非公開に設定します。最後に `Create repository from template` をクリックすると、新しいリポジトリが作成されます。(以下は第1章の `hello_app` を作成する場合の例です) 34 | ![テンプレートリポジトリの作成画面](https://i.gyazo.com/2e0188742504ec559109ba35a6b3714d.png) 35 | 36 | 1. 作成したリポジトリに飛んだら、`Code` から `Codespaces` タブに移動し、`Create codespace on main` をクリックします。 37 | ![テンプレートリポジトリから Codespaces へ](https://i.gyazo.com/17c40d8c1453de7a5db9d7ed6b603db6.png) 38 | 39 | 1. 環境構築が完了するのを待ちます(1〜2分ほど掛かります) 40 | ![Codespaces の立ち上げ中の画面](https://i.gyazo.com/1dc81bccd2f416bc936cd60f348a6d7a.png) 41 | 42 | 1. Railsチュートリアルのロゴ画像が表示されたら完成です! 43 | ![Codespaces による環境構築の完了画面Top](https://i.gyazo.com/b3af38fd1f8b2824791da9001a2bf6a0.png) 44 | 45 | `rails new` や `Gemfile` の更新、`rails server` を立ち上がるところまで(難しいとされる「環境構築」が終わるところまで)が完了している状態なので、**第1章・第2章・第3章のコードを書くところから始められます!** 📝✨ 46 | 47 | 例えば第1章の場合は「[1.3.2 `rails server`](https://railstutorial.jp/chapters/beginning#sec-rails_server)」の途中から、すなわち `rails server` を立ち上げたところからスタートできます。 48 | 49 | > :memo: Codespaces によってココまで自動化されていますが、**1.3.2 以前の内容(何が自動化されたのか)を知ることも大事**です。このまま 1.3.2 以降に進めていただいてももちろん大丈夫ですが、どこかの段階で 1.3.2 以前の内容にも目を通しておくと、知識は広がります。 50 | 51 |
52 | 53 | ## インストール済みの拡張機能について 54 | より良い学習体験に繋げるため、本テンプレートには以下の VS Code 拡張機能がデフォルトで入っています。 55 | 56 | - [:octocat: Shopify/ruby-lsp](https://github.com/Shopify/ruby-lsp): 57 | - Ruby コードを色分けして表示するハイライト機能や、コード補完機能などが使えます(以下は[公式のデモ動画](https://github.com/Shopify/ruby-lsp/tree/main/vscode#features)です)\ 58 | ![Ruby LSP Official DEMO](https://i.gyazo.com/71a5c5114b7836d942a5145ca58eadb9.gif) \ 59 | 参考記事: [Ruby LSPのコードナビゲーションで強化された主な機能 - TechRacho](https://techracho.bpsinc.jp/hachi8833/2024_07_29/143652) 60 | 61 | - [:octocat: castwide/vscode-solargraph](https://github.com/castwide/vscode-solargraph): 62 | - Ruby コードの定義元が調べられるコードジャンプ機能や、ドキュメント表示機能などが使えます(以下は[公式のデモ動画](https://github.com/castwide/vscode-solargraph#readme)です) \ 63 | ![Solargraph Official DEMO](https://i.gyazo.com/5fac6a81088d814a5b8354431239b03d.gif) 64 | 65 | RuboCop によるコード整形、Ruby 公式デバッガーなどの拡張機能はお好みで追加してください。本テンプレートでは必要最低限の拡張機能に留めています。 66 | 67 | - [:octocat: misogi/vscode-ruby-rubocop](https://github.com/misogi/vscode-ruby-rubocop) 68 | - [:octocat: ruby/vscode-rdbg](https://github.com/ruby/vscode-rdbg) 69 | - [:octocat: ruby-debug/ruby-debug-ide](https://github.com/ruby-debug/ruby-debug-ide) 70 | - [:octocat: Shopify/vscode-shopify-ruby](https://github.com/Shopify/vscode-shopify-ruby) 71 | - [:octocat: primer/github-vscode-theme](https://github.com/primer/github-vscode-theme) 72 | 73 |
74 | 75 | ## よくあるエラーと解決方法 76 |
77 | ブラウザ別のエラー解決方法を見る(2023年3月時点) 78 |

Google Chrome - Webビューの読み込みエラー

79 | Chrome のエラー例1 80 |

Error: Could not register service workers: NotSupportedError ... などが表示され、「シンプルブラウザーは開いたけど何も表示されない」という場合があります。これは必要な Cookie が許可されていない場合に起こります。以下の例を参考に、サードパーティの Cookie を許可すると解決する場合が多いです。

81 | Chrome のエラー例2 82 |

Cookie を許可しても解決しない場合は、シンプルブラウザーの右端にある「ブラウザーで開く」アイコンをクリックしてください。ブラウザの別タブで画面が表示され、こちらの画面でも現在の状態をご確認いただけます。

83 | Chrome のエラー例3 84 |


85 | 86 |

Firefox - Webビューの読み込みエラー

87 |

上記の Chrome と同様に、シンプルブラウザーの画面が表示されない事があります。アドレスバーにある強化型トラッキング防止機能のアイコンをクリックし、「オフ」にすることでプレビューが表示されるようになります。

88 | Firefox のエラー例1 89 |

上記の機能をオフにしても解決しない場合は、シンプルブラウザーではなく「新規ウィンドウでサイトを開く」をクリックしてください。ブラウザの別タブで画面が表示され、こちらの画面でも現在の状態をご確認いただけます。

90 | Firefox のエラー例2 91 | Firefox のエラー例3 92 |


93 | 94 |

Safari - 入力の遅延・アイコンの一部非表示

95 |

Safari では問題なくことが多いです。ただし、文字入力をしてから、Codespaces 上の画面に表示されるまでが遅い場合があります。また一部のアイコンが表示されない現象も確認できています。開発する上で問題になるわけではないですが、もし気になる場合は Google Chrome など他のブラウザをお試しください。

96 | Safari のエラー例1 97 |
98 | 99 |

100 | 101 | ## 制作・ライセンス 102 | 103 | Copyright © [YassLab](http://yasslab.jp/) Inc.
104 | Railsチュートリアル運営チーム
105 | [https://railstutorial.jp/](https://railstutorial.jp/) 106 | 107 | 108 | ソースコードのライセンスは LICENSE をご確認ください。
109 | ロゴ画像やデモ動画などは各制作者の著作物となります。 110 |
111 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative "config/application" 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../stylesheets .css 3 | //= link_tree ../../javascript .js 4 | //= link_tree ../../../vendor/javascript .js 5 | -------------------------------------------------------------------------------- /app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yasslab/codespaces-railstutorial/52505b6a88c624269eae9556886343bc59a18227/app/assets/images/.keep -------------------------------------------------------------------------------- /app/assets/stylesheets/application.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll be compiled into application.css, which will include all the files 3 | * listed below. 4 | * 5 | * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's 6 | * vendor/assets/stylesheets directory can be referenced here using a relative path. 7 | * 8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the 9 | * compiled file so the styles you add here take precedence over styles defined in any other CSS 10 | * files in this directory. Styles in this file should be added after the last require_* statement. 11 | * It is generally better to create a new file per style scope. 12 | * 13 | *= require_tree . 14 | *= require_self 15 | */ 16 | -------------------------------------------------------------------------------- /app/assets/stylesheets/hello.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", 4 | "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | .codespaces { 11 | text-align: center; 12 | } 13 | .codespaces code { 14 | font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", 15 | monospace; 16 | } 17 | .codespaces-logo { 18 | height: 40vmin; 19 | pointer-events: none; 20 | } 21 | .codespaces-header { 22 | background-color: #282c34; 23 | min-height: 100vh; 24 | display: flex; 25 | flex-direction: column; 26 | align-items: center; 27 | justify-content: center; 28 | font-size: calc(10px + 2vmin); 29 | color: white; 30 | } 31 | .codespaces-link { 32 | color: #61dafb; 33 | } 34 | 35 | .heart { 36 | color: #ff0000; 37 | } 38 | .small { 39 | font-size: 0.75rem; 40 | } 41 | -------------------------------------------------------------------------------- /app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | end 3 | -------------------------------------------------------------------------------- /app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yasslab/codespaces-railstutorial/52505b6a88c624269eae9556886343bc59a18227/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /app/controllers/hello_controller.rb: -------------------------------------------------------------------------------- 1 | class HelloController < ApplicationController 2 | def index 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/hello_codespaces_helper.rb: -------------------------------------------------------------------------------- 1 | module HelloCodespacesHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/javascript/application.js: -------------------------------------------------------------------------------- 1 | // Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails 2 | import "@hotwired/turbo-rails" 3 | import "controllers" 4 | -------------------------------------------------------------------------------- /app/javascript/controllers/application.js: -------------------------------------------------------------------------------- 1 | import { Application } from "@hotwired/stimulus" 2 | 3 | const application = Application.start() 4 | 5 | // Configure Stimulus development experience 6 | application.debug = false 7 | window.Stimulus = application 8 | 9 | export { application } 10 | -------------------------------------------------------------------------------- /app/javascript/controllers/hello_controller.js: -------------------------------------------------------------------------------- 1 | import { Controller } from "@hotwired/stimulus" 2 | 3 | export default class extends Controller { 4 | connect() { 5 | this.element.textContent = "Hello World!" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /app/javascript/controllers/index.js: -------------------------------------------------------------------------------- 1 | // Import and register all your controllers from the importmap under controllers/* 2 | 3 | import { application } from "controllers/application" 4 | 5 | // Eager load all controllers defined in the import map under controllers/**/*_controller 6 | import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading" 7 | eagerLoadControllersFrom("controllers", application) 8 | 9 | // Lazy load controllers as they appear in the DOM (remember not to preload controllers in import map!) 10 | // import { lazyLoadControllersFrom } from "@hotwired/stimulus-loading" 11 | // lazyLoadControllersFrom("controllers", application) 12 | -------------------------------------------------------------------------------- /app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | # Automatically retry jobs that encountered a deadlock 3 | # retry_on ActiveRecord::Deadlocked 4 | 5 | # Most jobs are safe to ignore if the underlying records are no longer available 6 | # discard_on ActiveJob::DeserializationError 7 | end 8 | -------------------------------------------------------------------------------- /app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: "from@example.com" 3 | layout "mailer" 4 | end 5 | -------------------------------------------------------------------------------- /app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | primary_abstract_class 3 | end 4 | -------------------------------------------------------------------------------- /app/models/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yasslab/codespaces-railstutorial/52505b6a88c624269eae9556886343bc59a18227/app/models/concerns/.keep -------------------------------------------------------------------------------- /app/views/hello/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 | 6 |

7 | Codespaces 8 | ♥️ 9 | Railsチュートリアル 10 |

11 |

12 | 🎓✨
13 | ロゴ画像が表示されたらセットアップ完了です! 14 |

15 |
16 |
17 | -------------------------------------------------------------------------------- /app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Sample App 5 | 6 | <%= csrf_meta_tags %> 7 | <%= csp_meta_tag %> 8 | 9 | <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> 10 | <%= javascript_importmap_tags %> 11 | 12 | 13 | 14 | <%= yield %> 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | # 5 | # This file was generated by Bundler. 6 | # 7 | # The application 'bundle' is installed as part of a gem, and 8 | # this file is here to facilitate running it. 9 | # 10 | 11 | require "rubygems" 12 | 13 | m = Module.new do 14 | module_function 15 | 16 | def invoked_as_script? 17 | File.expand_path($0) == File.expand_path(__FILE__) 18 | end 19 | 20 | def env_var_version 21 | ENV["BUNDLER_VERSION"] 22 | end 23 | 24 | def cli_arg_version 25 | return unless invoked_as_script? # don't want to hijack other binstubs 26 | return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update` 27 | bundler_version = nil 28 | update_index = nil 29 | ARGV.each_with_index do |a, i| 30 | if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN 31 | bundler_version = a 32 | end 33 | next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/ 34 | bundler_version = $1 35 | update_index = i 36 | end 37 | bundler_version 38 | end 39 | 40 | def gemfile 41 | gemfile = ENV["BUNDLE_GEMFILE"] 42 | return gemfile if gemfile && !gemfile.empty? 43 | 44 | File.expand_path("../Gemfile", __dir__) 45 | end 46 | 47 | def lockfile 48 | lockfile = 49 | case File.basename(gemfile) 50 | when "gems.rb" then gemfile.sub(/\.rb$/, gemfile) 51 | else "#{gemfile}.lock" 52 | end 53 | File.expand_path(lockfile) 54 | end 55 | 56 | def lockfile_version 57 | return unless File.file?(lockfile) 58 | lockfile_contents = File.read(lockfile) 59 | return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/ 60 | Regexp.last_match(1) 61 | end 62 | 63 | def bundler_requirement 64 | @bundler_requirement ||= 65 | env_var_version || cli_arg_version || 66 | bundler_requirement_for(lockfile_version) 67 | end 68 | 69 | def bundler_requirement_for(version) 70 | return "#{Gem::Requirement.default}.a" unless version 71 | 72 | bundler_gem_version = Gem::Version.new(version) 73 | 74 | requirement = bundler_gem_version.approximate_recommendation 75 | 76 | return requirement unless Gem.rubygems_version < Gem::Version.new("2.7.0") 77 | 78 | requirement += ".a" if bundler_gem_version.prerelease? 79 | 80 | requirement 81 | end 82 | 83 | def load_bundler! 84 | ENV["BUNDLE_GEMFILE"] ||= gemfile 85 | 86 | activate_bundler 87 | end 88 | 89 | def activate_bundler 90 | gem_error = activation_error_handling do 91 | gem "bundler", bundler_requirement 92 | end 93 | return if gem_error.nil? 94 | require_error = activation_error_handling do 95 | require "bundler/version" 96 | end 97 | return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION)) 98 | warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`" 99 | exit 42 100 | end 101 | 102 | def activation_error_handling 103 | yield 104 | nil 105 | rescue StandardError, LoadError => e 106 | e 107 | end 108 | end 109 | 110 | m.load_bundler! 111 | 112 | if m.invoked_as_script? 113 | load Gem.bin_path("bundler", "bundle") 114 | end 115 | -------------------------------------------------------------------------------- /bin/importmap: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require_relative "../config/application" 4 | require "importmap/commands" 5 | -------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_PATH = File.expand_path("../config/application", __dir__) 3 | require_relative "../config/boot" 4 | require "rails/commands" 5 | -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative "../config/boot" 3 | require "rake" 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require "fileutils" 3 | 4 | # path to your application root. 5 | APP_ROOT = File.expand_path("..", __dir__) 6 | 7 | def system!(*args) 8 | system(*args) || abort("\n== Command #{args} failed ==") 9 | end 10 | 11 | FileUtils.chdir APP_ROOT do 12 | # This script is a way to set up or update your development environment automatically. 13 | # This script is idempotent, so that you can run it at any time and get an expectable outcome. 14 | # Add necessary setup steps to this file. 15 | 16 | puts "== Installing dependencies ==" 17 | system! "gem install bundler --conservative" 18 | system("bundle check") || system!("bundle install") 19 | 20 | # puts "\n== Copying sample files ==" 21 | # unless File.exist?("config/database.yml") 22 | # FileUtils.cp "config/database.yml.sample", "config/database.yml" 23 | # end 24 | 25 | puts "\n== Preparing database ==" 26 | system! "bin/rails db:prepare" 27 | 28 | puts "\n== Removing old logs and tempfiles ==" 29 | system! "bin/rails log:clear tmp:clear" 30 | 31 | puts "\n== Restarting application server ==" 32 | system! "bin/rails restart" 33 | end 34 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative "config/environment" 4 | 5 | run Rails.application 6 | Rails.application.load_server 7 | -------------------------------------------------------------------------------- /config/application.rb: -------------------------------------------------------------------------------- 1 | require_relative "boot" 2 | 3 | require "rails/all" 4 | 5 | # Require the gems listed in Gemfile, including any gems 6 | # you've limited to :test, :development, or :production. 7 | Bundler.require(*Rails.groups) 8 | 9 | module SampleApp 10 | class Application < Rails::Application 11 | # Initialize configuration defaults for originally generated Rails version. 12 | config.load_defaults 7.0 13 | 14 | # Configuration for the application, engines, and railties goes here. 15 | # 16 | # These settings can be overridden in specific environments using the files 17 | # in config/environments, which are processed later. 18 | # 19 | # config.time_zone = "Central Time (US & Canada)" 20 | # config.eager_load_paths << Rails.root.join("extras") 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) 2 | 3 | require "bundler/setup" # Set up gems listed in the Gemfile. 4 | require "bootsnap/setup" # Speed up boot time by caching expensive operations. 5 | -------------------------------------------------------------------------------- /config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: test 6 | 7 | production: 8 | adapter: redis 9 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> 10 | channel_prefix: codespaces_try_rails_production 11 | -------------------------------------------------------------------------------- /config/credentials.yml.enc: -------------------------------------------------------------------------------- 1 | NCs9M8uakg1CDYJENuGaipzymY8uG6i5gzghsy4npa3gYmGfYKPHMnEcJHCVHlM3gxDNJBteUqkRCxHQ5WQId8hzgxoQCL5RX7rtQ8XUzkJwgSUjKvbCrG5atjKkN9XuL91is5vtEN5W7vEz3qxN7Rp33QbNFiDfLs71F3zHVDYEMi6Dy1QMhVCa1v/tyRjBu/5m37RuiYF5FzWJnh4LhexSVr7Agm4LRLLN6qLCpoAe6D3TPHHBdtu7Pvy8jlrEfnnkUJ61wrj8+kOL4uLtpFShdYKhDkoTjQk7TCOgWyifnHAXazkBZoJZ1QYv/tZ9/ZoHvMEQ2dtGHlyTX8fbKtI13d2CFjGaDNKvRuurxE8dbeyiTfbycvve46+cz9OTlmhh0SGt24R1WV6GBKoDUeoHrIiBvW5qmKka--dQ0rodxmfgFLg2y/--t2x0gQjh8FYlk8v79vLSNg== -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite. Versions 3.8.0 and up are supported. 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem "sqlite3" 6 | # 7 | default: &default 8 | adapter: sqlite3 9 | pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> 10 | timeout: 5000 11 | 12 | development: 13 | <<: *default 14 | database: db/development.sqlite3 15 | 16 | # Warning: The database defined as "test" will be erased and 17 | # re-generated from your development database when you run "rake". 18 | # Do not set this db to the same as development or production. 19 | test: 20 | <<: *default 21 | database: db/test.sqlite3 22 | 23 | production: 24 | <<: *default 25 | database: db/production.sqlite3 26 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative "application" 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /config/environments/development.rb: -------------------------------------------------------------------------------- 1 | require "active_support/core_ext/integer/time" 2 | 3 | Rails.application.configure do 4 | # Settings specified here will take precedence over those in config/application.rb. 5 | 6 | # In the development environment your application's code is reloaded any time 7 | # it changes. This slows down response time but is perfect for development 8 | # since you don't have to restart the web server when you make code changes. 9 | config.cache_classes = false 10 | 11 | # Do not eager load code on boot. 12 | config.eager_load = false 13 | 14 | # Show full error reports. 15 | config.consider_all_requests_local = true 16 | 17 | # Enable server timing 18 | config.server_timing = true 19 | 20 | # Add the following line to disable forgery_protection_origin_check 21 | config.action_controller.forgery_protection_origin_check = false 22 | 23 | # Enable/disable caching. By default caching is disabled. 24 | # Run rails dev:cache to toggle caching. 25 | if Rails.root.join("tmp/caching-dev.txt").exist? 26 | config.action_controller.perform_caching = true 27 | config.action_controller.enable_fragment_cache_logging = true 28 | 29 | config.cache_store = :memory_store 30 | config.public_file_server.headers = { 31 | "Cache-Control" => "public, max-age=#{2.days.to_i}" 32 | } 33 | else 34 | config.action_controller.perform_caching = false 35 | 36 | config.cache_store = :null_store 37 | end 38 | 39 | # Store uploaded files on the local file system (see config/storage.yml for options). 40 | config.active_storage.service = :local 41 | 42 | # Don't care if the mailer can't send. 43 | config.action_mailer.raise_delivery_errors = false 44 | 45 | config.action_mailer.perform_caching = false 46 | 47 | # Print deprecation notices to the Rails logger. 48 | config.active_support.deprecation = :log 49 | 50 | # Raise exceptions for disallowed deprecations. 51 | config.active_support.disallowed_deprecation = :raise 52 | 53 | # Tell Active Support which deprecation messages to disallow. 54 | config.active_support.disallowed_deprecation_warnings = [] 55 | 56 | # Raise an error on page load if there are pending migrations. 57 | config.active_record.migration_error = :page_load 58 | 59 | # Highlight code that triggered database queries in logs. 60 | config.active_record.verbose_query_logs = true 61 | 62 | # Suppress logger output for asset requests. 63 | config.assets.quiet = true 64 | 65 | pf_domain = ENV['GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN'] 66 | config.action_dispatch.default_headers = { 67 | 'X-Frame-Options' => "ALLOW-FROM #{pf_domain}" 68 | } 69 | 70 | # Raises error for missing translations. 71 | # config.i18n.raise_on_missing_translations = true 72 | 73 | # Annotate rendered view with file names. 74 | # config.action_view.annotate_rendered_view_with_filenames = true 75 | 76 | # Uncomment if you wish to allow Action Cable access from any origin. 77 | # config.action_cable.disable_request_forgery_protection = true 78 | 79 | # Allow requests from our preview domain. 80 | pf_host = "#{ENV['CODESPACE_NAME']}-3000.#{pf_domain}" 81 | config.hosts << pf_host 82 | 83 | config.action_cable.allowed_request_origins = ["https://#{pf_host}"] 84 | end 85 | -------------------------------------------------------------------------------- /config/environments/production.rb: -------------------------------------------------------------------------------- 1 | require "active_support/core_ext/integer/time" 2 | 3 | Rails.application.configure do 4 | # Settings specified here will take precedence over those in config/application.rb. 5 | 6 | # Code is not reloaded between requests. 7 | config.cache_classes = true 8 | 9 | # Eager load code on boot. This eager loads most of Rails and 10 | # your application in memory, allowing both threaded web servers 11 | # and those relying on copy on write to perform better. 12 | # Rake tasks automatically ignore this option for performance. 13 | config.eager_load = true 14 | 15 | # Full error reports are disabled and caching is turned on. 16 | config.consider_all_requests_local = false 17 | config.action_controller.perform_caching = true 18 | 19 | # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] 20 | # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). 21 | # config.require_master_key = true 22 | 23 | # Disable serving static files from the `/public` folder by default since 24 | # Apache or NGINX already handles this. 25 | config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? 26 | 27 | # Compress CSS using a preprocessor. 28 | # config.assets.css_compressor = :sass 29 | 30 | # Do not fallback to assets pipeline if a precompiled asset is missed. 31 | config.assets.compile = false 32 | 33 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. 34 | # config.asset_host = "http://assets.example.com" 35 | 36 | # Specifies the header that your server uses for sending files. 37 | # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache 38 | # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX 39 | 40 | # Store uploaded files on the local file system (see config/storage.yml for options). 41 | config.active_storage.service = :local 42 | 43 | # Mount Action Cable outside main process or domain. 44 | # config.action_cable.mount_path = nil 45 | # config.action_cable.url = "wss://example.com/cable" 46 | # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ] 47 | 48 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 49 | # config.force_ssl = true 50 | 51 | # Include generic and useful information about system operation, but avoid logging too much 52 | # information to avoid inadvertent exposure of personally identifiable information (PII). 53 | config.log_level = :info 54 | 55 | # Prepend all log lines with the following tags. 56 | config.log_tags = [ :request_id ] 57 | 58 | # Use a different cache store in production. 59 | # config.cache_store = :mem_cache_store 60 | 61 | # Use a real queuing backend for Active Job (and separate queues per environment). 62 | # config.active_job.queue_adapter = :resque 63 | # config.active_job.queue_name_prefix = "codespaces_try_rails_production" 64 | 65 | config.action_mailer.perform_caching = false 66 | 67 | # Ignore bad email addresses and do not raise email delivery errors. 68 | # Set this to true and configure the email server for immediate delivery to raise delivery errors. 69 | # config.action_mailer.raise_delivery_errors = false 70 | 71 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 72 | # the I18n.default_locale when a translation cannot be found). 73 | config.i18n.fallbacks = true 74 | 75 | # Don't log any deprecations. 76 | config.active_support.report_deprecations = false 77 | 78 | # Use default logging formatter so that PID and timestamp are not suppressed. 79 | config.log_formatter = ::Logger::Formatter.new 80 | 81 | # Use a different logger for distributed setups. 82 | # require "syslog/logger" 83 | # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name") 84 | 85 | if ENV["RAILS_LOG_TO_STDOUT"].present? 86 | logger = ActiveSupport::Logger.new(STDOUT) 87 | logger.formatter = config.log_formatter 88 | config.logger = ActiveSupport::TaggedLogging.new(logger) 89 | end 90 | 91 | # Do not dump schema after migrations. 92 | config.active_record.dump_schema_after_migration = false 93 | end 94 | -------------------------------------------------------------------------------- /config/environments/test.rb: -------------------------------------------------------------------------------- 1 | require "active_support/core_ext/integer/time" 2 | 3 | # The test environment is used exclusively to run your application's 4 | # test suite. You never need to work with it otherwise. Remember that 5 | # your test database is "scratch space" for the test suite and is wiped 6 | # and recreated between test runs. Don't rely on the data there! 7 | 8 | Rails.application.configure do 9 | # Settings specified here will take precedence over those in config/application.rb. 10 | 11 | # Turn false under Spring and add config.action_view.cache_template_loading = true. 12 | config.cache_classes = true 13 | 14 | # Eager loading loads your whole application. When running a single test locally, 15 | # this probably isn't necessary. It's a good idea to do in a continuous integration 16 | # system, or in some way before deploying your code. 17 | config.eager_load = ENV["CI"].present? 18 | 19 | # Configure public file server for tests with Cache-Control for performance. 20 | config.public_file_server.enabled = true 21 | config.public_file_server.headers = { 22 | "Cache-Control" => "public, max-age=#{1.hour.to_i}" 23 | } 24 | 25 | # Show full error reports and disable caching. 26 | config.consider_all_requests_local = true 27 | config.action_controller.perform_caching = false 28 | config.cache_store = :null_store 29 | 30 | # Raise exceptions instead of rendering exception templates. 31 | config.action_dispatch.show_exceptions = false 32 | 33 | # Disable request forgery protection in test environment. 34 | config.action_controller.allow_forgery_protection = false 35 | 36 | # Store uploaded files on the local file system in a temporary directory. 37 | config.active_storage.service = :test 38 | 39 | config.action_mailer.perform_caching = false 40 | 41 | # Tell Action Mailer not to deliver emails to the real world. 42 | # The :test delivery method accumulates sent emails in the 43 | # ActionMailer::Base.deliveries array. 44 | config.action_mailer.delivery_method = :test 45 | 46 | # Print deprecation notices to the stderr. 47 | config.active_support.deprecation = :stderr 48 | 49 | # Raise exceptions for disallowed deprecations. 50 | config.active_support.disallowed_deprecation = :raise 51 | 52 | # Tell Active Support which deprecation messages to disallow. 53 | config.active_support.disallowed_deprecation_warnings = [] 54 | 55 | # Raises error for missing translations. 56 | # config.i18n.raise_on_missing_translations = true 57 | 58 | # Annotate rendered view with file names. 59 | # config.action_view.annotate_rendered_view_with_filenames = true 60 | end 61 | -------------------------------------------------------------------------------- /config/importmap.rb: -------------------------------------------------------------------------------- 1 | # Pin npm packages by running ./bin/importmap 2 | 3 | pin "application", preload: true 4 | pin "@hotwired/turbo-rails", to: "turbo.min.js", preload: true 5 | pin "@hotwired/stimulus", to: "stimulus.min.js", preload: true 6 | pin "@hotwired/stimulus-loading", to: "stimulus-loading.js", preload: true 7 | pin_all_from "app/javascript/controllers", under: "controllers" 8 | -------------------------------------------------------------------------------- /config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = "1.0" 5 | 6 | # Add additional assets to the asset load path. 7 | # Rails.application.config.assets.paths << Emoji.images_path 8 | 9 | # Precompile additional assets. 10 | # application.js, application.css, and all non-JS/CSS in the app/assets 11 | # folder are already added. 12 | # Rails.application.config.assets.precompile += %w( admin.js admin.css ) 13 | -------------------------------------------------------------------------------- /config/initializers/content_security_policy.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Define an application-wide content security policy. 4 | # See the Securing Rails Applications Guide for more information: 5 | # https://guides.rubyonrails.org/security.html#content-security-policy-header 6 | 7 | # Rails.application.configure do 8 | # config.content_security_policy do |policy| 9 | # policy.default_src :self, :https 10 | # policy.font_src :self, :https, :data 11 | # policy.img_src :self, :https, :data 12 | # policy.object_src :none 13 | # policy.script_src :self, :https 14 | # policy.style_src :self, :https 15 | # # Specify URI for violation reports 16 | # # policy.report_uri "/csp-violation-report-endpoint" 17 | # end 18 | # 19 | # # Generate session nonces for permitted importmap and inline scripts 20 | # config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s } 21 | # config.content_security_policy_nonce_directives = %w(script-src) 22 | # 23 | # # Report violations without enforcing the policy. 24 | # # config.content_security_policy_report_only = true 25 | # end 26 | -------------------------------------------------------------------------------- /config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure parameters to be filtered from the log file. Use this to limit dissemination of 4 | # sensitive information. See the ActiveSupport::ParameterFilter documentation for supported 5 | # notations and behaviors. 6 | Rails.application.config.filter_parameters += [ 7 | :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn 8 | ] 9 | -------------------------------------------------------------------------------- /config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, "\\1en" 8 | # inflect.singular /^(ox)en/i, "\\1" 9 | # inflect.irregular "person", "people" 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym "RESTful" 16 | # end 17 | -------------------------------------------------------------------------------- /config/initializers/permissions_policy.rb: -------------------------------------------------------------------------------- 1 | # Define an application-wide HTTP permissions policy. For further 2 | # information see https://developers.google.com/web/updates/2018/06/feature-policy 3 | # 4 | # Rails.application.config.permissions_policy do |f| 5 | # f.camera :none 6 | # f.gyroscope :none 7 | # f.microphone :none 8 | # f.usb :none 9 | # f.fullscreen :self 10 | # f.payment :self, "https://secure.example.com" 11 | # end 12 | -------------------------------------------------------------------------------- /config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t "hello" 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t("hello") %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # The following keys must be escaped otherwise they will not be retrieved by 20 | # the default I18n backend: 21 | # 22 | # true, false, on, off, yes, no 23 | # 24 | # Instead, surround them with single quotes. 25 | # 26 | # en: 27 | # "true": "foo" 28 | # 29 | # To learn more, please read the Rails Internationalization guide 30 | # available at https://guides.rubyonrails.org/i18n.html. 31 | 32 | en: 33 | hello: "Hello world" 34 | -------------------------------------------------------------------------------- /config/puma.rb: -------------------------------------------------------------------------------- 1 | # Puma can serve each request in a thread from an internal thread pool. 2 | # The `threads` method setting takes two numbers: a minimum and maximum. 3 | # Any libraries that use thread pools should be configured to match 4 | # the maximum value specified for Puma. Default is set to 5 threads for minimum 5 | # and maximum; this matches the default thread size of Active Record. 6 | # 7 | max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } 8 | min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count } 9 | threads min_threads_count, max_threads_count 10 | 11 | # Specifies the `worker_timeout` threshold that Puma will use to wait before 12 | # terminating a worker in development environments. 13 | # 14 | worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development" 15 | 16 | # Specifies the `port` that Puma will listen on to receive requests; default is 3000. 17 | # 18 | port ENV.fetch("PORT") { 3000 } 19 | 20 | # Specifies the `environment` that Puma will run in. 21 | # 22 | environment ENV.fetch("RAILS_ENV") { "development" } 23 | 24 | # Specifies the `pidfile` that Puma will use. 25 | pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } 26 | 27 | # Specifies the number of `workers` to boot in clustered mode. 28 | # Workers are forked web server processes. If using threads and workers together 29 | # the concurrency of the application would be max `threads` * `workers`. 30 | # Workers do not work on JRuby or Windows (both of which do not support 31 | # processes). 32 | # 33 | # workers ENV.fetch("WEB_CONCURRENCY") { 2 } 34 | 35 | # Use the `preload_app!` method when specifying a `workers` number. 36 | # This directive tells Puma to first boot the application and load code 37 | # before forking the application. This takes advantage of Copy On Write 38 | # process behavior so workers use less memory. 39 | # 40 | # preload_app! 41 | 42 | # Allow puma to be restarted by `bin/rails restart` command. 43 | plugin :tmp_restart 44 | -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | root "hello#index" 3 | end 4 | -------------------------------------------------------------------------------- /config/storage.yml: -------------------------------------------------------------------------------- 1 | test: 2 | service: Disk 3 | root: <%= Rails.root.join("tmp/storage") %> 4 | 5 | local: 6 | service: Disk 7 | root: <%= Rails.root.join("storage") %> 8 | 9 | # Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) 10 | # amazon: 11 | # service: S3 12 | # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> 13 | # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> 14 | # region: us-east-1 15 | # bucket: your_own_bucket-<%= Rails.env %> 16 | 17 | # Remember not to checkin your GCS keyfile to a repository 18 | # google: 19 | # service: GCS 20 | # project: your_project 21 | # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> 22 | # bucket: your_own_bucket-<%= Rails.env %> 23 | 24 | # Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key) 25 | # microsoft: 26 | # service: AzureStorage 27 | # storage_account_name: your_account_name 28 | # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %> 29 | # container: your_container_name-<%= Rails.env %> 30 | 31 | # mirror: 32 | # service: Mirror 33 | # primary: local 34 | # mirrors: [ amazon, google, microsoft ] 35 | -------------------------------------------------------------------------------- /db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # movies = Movie.create([{ name: "Star Wars" }, { name: "Lord of the Rings" }]) 7 | # Character.create(name: "Luke", movie: movies.first) 8 | -------------------------------------------------------------------------------- /lib/assets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yasslab/codespaces-railstutorial/52505b6a88c624269eae9556886343bc59a18227/lib/assets/.keep -------------------------------------------------------------------------------- /lib/tasks/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yasslab/codespaces-railstutorial/52505b6a88c624269eae9556886343bc59a18227/lib/tasks/.keep -------------------------------------------------------------------------------- /log/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yasslab/codespaces-railstutorial/52505b6a88c624269eae9556886343bc59a18227/log/.keep -------------------------------------------------------------------------------- /public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The page you were looking for doesn't exist (404) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

The page you were looking for doesn't exist.

62 |

You may have mistyped the address or the page may have moved.

63 |
64 |

If you are the application owner check the logs for more information.

65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The change you wanted was rejected (422) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

The change you wanted was rejected.

62 |

Maybe you tried to change something you didn't have access to.

63 |
64 |

If you are the application owner check the logs for more information.

65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We're sorry, but something went wrong (500) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

We're sorry, but something went wrong.

62 |
63 |

If you are the application owner check the logs for more information.

64 |
65 | 66 | 67 | -------------------------------------------------------------------------------- /public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yasslab/codespaces-railstutorial/52505b6a88c624269eae9556886343bc59a18227/public/apple-touch-icon-precomposed.png -------------------------------------------------------------------------------- /public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yasslab/codespaces-railstutorial/52505b6a88c624269eae9556886343bc59a18227/public/apple-touch-icon.png -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yasslab/codespaces-railstutorial/52505b6a88c624269eae9556886343bc59a18227/public/favicon.ico -------------------------------------------------------------------------------- /public/railstutorial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yasslab/codespaces-railstutorial/52505b6a88c624269eae9556886343bc59a18227/public/railstutorial.png -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | -------------------------------------------------------------------------------- /storage/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yasslab/codespaces-railstutorial/52505b6a88c624269eae9556886343bc59a18227/storage/.keep -------------------------------------------------------------------------------- /test/application_system_test_case.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ApplicationSystemTestCase < ActionDispatch::SystemTestCase 4 | driven_by :selenium, using: :chrome, screen_size: [1400, 1400] 5 | end 6 | -------------------------------------------------------------------------------- /test/channels/application_cable/connection_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ApplicationCable::ConnectionTest < ActionCable::Connection::TestCase 4 | # test "connects with cookies" do 5 | # cookies.signed[:user_id] = 42 6 | # 7 | # connect 8 | # 9 | # assert_equal connection.user_id, "42" 10 | # end 11 | end 12 | -------------------------------------------------------------------------------- /test/controllers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yasslab/codespaces-railstutorial/52505b6a88c624269eae9556886343bc59a18227/test/controllers/.keep -------------------------------------------------------------------------------- /test/controllers/hello_codespaces_controller_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class HelloCodespacesControllerTest < ActionDispatch::IntegrationTest 4 | # test "should get index" do 5 | # get "/" 6 | # assert_response :success 7 | # end 8 | end 9 | -------------------------------------------------------------------------------- /test/fixtures/files/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yasslab/codespaces-railstutorial/52505b6a88c624269eae9556886343bc59a18227/test/fixtures/files/.keep -------------------------------------------------------------------------------- /test/helpers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yasslab/codespaces-railstutorial/52505b6a88c624269eae9556886343bc59a18227/test/helpers/.keep -------------------------------------------------------------------------------- /test/integration/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yasslab/codespaces-railstutorial/52505b6a88c624269eae9556886343bc59a18227/test/integration/.keep -------------------------------------------------------------------------------- /test/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yasslab/codespaces-railstutorial/52505b6a88c624269eae9556886343bc59a18227/test/mailers/.keep -------------------------------------------------------------------------------- /test/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yasslab/codespaces-railstutorial/52505b6a88c624269eae9556886343bc59a18227/test/models/.keep -------------------------------------------------------------------------------- /test/system/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yasslab/codespaces-railstutorial/52505b6a88c624269eae9556886343bc59a18227/test/system/.keep -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV["RAILS_ENV"] ||= "test" 2 | require_relative "../config/environment" 3 | require "rails/test_help" 4 | 5 | class ActiveSupport::TestCase 6 | # Run tests in parallel with specified workers 7 | parallelize(workers: :number_of_processors) 8 | 9 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 10 | fixtures :all 11 | 12 | # Add more helper methods to be used by all tests here... 13 | end 14 | -------------------------------------------------------------------------------- /tmp/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yasslab/codespaces-railstutorial/52505b6a88c624269eae9556886343bc59a18227/tmp/.keep -------------------------------------------------------------------------------- /tmp/pids/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yasslab/codespaces-railstutorial/52505b6a88c624269eae9556886343bc59a18227/tmp/pids/.keep -------------------------------------------------------------------------------- /tmp/storage/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yasslab/codespaces-railstutorial/52505b6a88c624269eae9556886343bc59a18227/tmp/storage/.keep -------------------------------------------------------------------------------- /vendor/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yasslab/codespaces-railstutorial/52505b6a88c624269eae9556886343bc59a18227/vendor/.keep -------------------------------------------------------------------------------- /vendor/javascript/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yasslab/codespaces-railstutorial/52505b6a88c624269eae9556886343bc59a18227/vendor/javascript/.keep --------------------------------------------------------------------------------