Just doing some simple Ruby on rails hello world: Getting Started with Rails — Ruby on Rails Guides
Super simple but for some reason I am facing an issue when reaching the url http://localhost:3000/articles within the browser.
This is the rest client call which works
Started GET "/articles" for ::1 at 2024-09-19 21:13:06 -0700
Processing by ArticlesController#index as */*
Rendering layout layouts/application.html.erb
Rendering articles/index.html.erb within layouts/application
Rendered articles/index.html.erb within layouts/application (Duration: 0.3ms | GC: 0.0ms)
Rendered layout layouts/application.html.erb (Duration: 300.6ms | GC: 83.0ms)
Completed 200 OK in 305ms (Views: 303.0ms | ActiveRecord: 0.0ms (0 queries, 0 cached) | GC: 83.0ms)
Response:
<!-- BEGIN app/views/layouts/application.html.erb -->
<!DOCTYPE html>
<html>
<head>
<title>Myapp</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="csrf-param" content="authenticity_token" />
<meta name="csrf-token"
content="95dSx7ruojURNVRpeX2d03QEgxAT5zQjM86NmWjsRx07drHu33H3KsiqExj37UDCNqiQfrHjpHPYyx_pVCJJWQ" />
<link rel="manifest" href="/manifest.json">
<link rel="icon" href="/icon.png" type="image/png">
<link rel="icon" href="/icon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/icon.png">
<link rel="stylesheet"
href="/assets/application-e0cf9d8fcb18bf7f909d8d91a5e78499f82ac29523d475bf3a9ab265d5e2b451.css"
data-turbo-track="reload" />
<script type="importmap" data-turbo-track="reload">{
"imports": {
"application": "/assets/application-37f365cbecf1fa2810a8303f4b6571676fa1f9c56c248528bc14ddb857531b95.js",
"@hotwired/turbo-rails": "/assets/turbo.min-f3765a09513ca1417099ce92257ef54b9d4cf3a7addc7dcbb1d6d848d307ee8a.js",
"@hotwired/stimulus": "/assets/stimulus.min-dd364f16ec9504dfb72672295637a1c8838773b01c0b441bd41008124c407894.js",
"@hotwired/stimulus-loading": "/assets/stimulus-loading-3576ce92b149ad5d6959438c6f291e2426c86df3b874c525b30faad51b0d96b3.js",
"controllers/application": "/assets/controllers/application-368d98631bccbf2349e0d4f8269afb3fe9625118341966de054759d96ea86c7e.js",
"controllers/hello_controller": "/assets/controllers/hello_controller-549135e8e7c683a538c3d6d517339ba470fcfb79d62f738a0a089ba41851a554.js",
"controllers": "/assets/controllers/index-31a9bee606cbc5cdb1593881f388bbf4c345bf693ea24e124f84b6d5c98ab648.js"
}
}</script>
<link rel="modulepreload"
href="/assets/application-37f365cbecf1fa2810a8303f4b6571676fa1f9c56c248528bc14ddb857531b95.js">
<link rel="modulepreload"
href="/assets/turbo.min-f3765a09513ca1417099ce92257ef54b9d4cf3a7addc7dcbb1d6d848d307ee8a.js">
<link rel="modulepreload"
href="/assets/stimulus.min-dd364f16ec9504dfb72672295637a1c8838773b01c0b441bd41008124c407894.js">
<link rel="modulepreload"
href="/assets/stimulus-loading-3576ce92b149ad5d6959438c6f291e2426c86df3b874c525b30faad51b0d96b3.js">
<link rel="modulepreload"
href="/assets/controllers/application-368d98631bccbf2349e0d4f8269afb3fe9625118341966de054759d96ea86c7e.js">
<link rel="modulepreload"
href="/assets/controllers/hello_controller-549135e8e7c683a538c3d6d517339ba470fcfb79d62f738a0a089ba41851a554.js">
<link rel="modulepreload"
href="/assets/controllers/index-31a9bee606cbc5cdb1593881f388bbf4c345bf693ea24e124f84b6d5c98ab648.js">
<script type="module">import "application"</script>
</head>
<body>
<!-- BEGIN app/views/articles/index.html.erb -->
<html>
<h1>Hello, Gord!</h1>
</html>
<!-- END app/views/articles/index.html.erb -->
</body>
</html>
<!-- END app/views/layouts/application.html.erb -->
`
This is the browser call which does not
Started GET "/articles" for ::1 at 2024-09-19 21:14:13 -0700
Processing by ArticlesController#index as HTML
Rendering public/406-unsupported-browser.html
Rendered public/406-unsupported-browser.html (Duration: 0.5ms | GC: 0.0ms)
Filter chain halted as #<Proc:0x000000010faa86f0 /Users/joe/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/actionpack-7.2.1/lib/action_controller/metal/allow_browser.rb:48 (lambda)> rendered or redirected
Completed 406 Not Acceptable in 5ms (Views: 1.2ms | ActiveRecord: 0.0ms (0 queries, 0 cached) | GC: 1.8ms)
Response:
<!DOCTYPE html>
<html>
<head>
<title>Your browser is not supported (406)</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<style>
.rails-default-error-page {
background-color: #EFEFEF;
color: #2E2F30;
text-align: center;
font-family: arial, sans-serif;
margin: 0;
}
.rails-default-error-page div.dialog {
width: 95%;
max-width: 33em;
margin: 4em auto 0;
}
.rails-default-error-page div.dialog > div {
border: 1px solid #CCC;
border-right-color: #999;
border-left-color: #999;
border-bottom-color: #BBB;
border-top: #B00100 solid 4px;
border-top-left-radius: 9px;
border-top-right-radius: 9px;
background-color: white;
padding: 7px 12% 0;
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
}
.rails-default-error-page h1 {
font-size: 100%;
color: #730E15;
line-height: 1.5em;
}
.rails-default-error-page div.dialog > p {
margin: 0 0 1em;
padding: 1em;
background-color: #F7F7F7;
border: 1px solid #CCC;
border-right-color: #999;
border-left-color: #999;
border-bottom-color: #999;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
border-top-color: #DADADA;
color: #666;
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
}
</style>
</head>
<body class="rails-default-error-page">
<!-- This file lives in public/406-unsupported-browser.html -->
<div class="dialog">
<div>
<h1>Your browser is not supported.</h1>
<p>Please upgrade your browser to continue.</p>
</div>
</div>
</body>
</html>
`
I’m wondering if the issue is ArticlesController#index as HTML
when it looks like my application is returning layouts/application.html.erb
it tells me my browser needs updated I’m running on Chrome Version 116.0.5845.187
I’ve tried on both chrome and safari (Version 14.1.2) but no joy. The annoying thing is that if I save the rest client response as whatever.html and open from chrome it displays fine.