'Ruby on rails, post request not displaying after submit action

I am using ruby and rails (I am following a tutorial and been told we do not need everything for a new rails app for this beginner session hence the skip functions below) In terminal, I run:

rails new rails-first-app --skip-active-storage --skip-action-mailbox --skip-test
cd rails-first-app
gh repo create --public --source=.
git push origin main

So this creates a new rails app and uploads it to github.

Then I run:

rails generate controller games

to create my new controller and I enter the correct view files, routes to connect the files and the methods in the controller.

Now this is where it starts to get weird. The app does not work most of the time- but with enough refreshes in terminal and using a new internet browser, the app works ONCE and then goes back to not working at all.

In the terminal, this is what shows when I refresh the app:

enter image description here

When the app does work it shows this: enter image description here

When the app does not work it shows this: enter image description here

I have highlighted the differences with the red lines. And have tried to google how to process the result as a HTML and not turbo_stream and why it does not Rack app.

Does anyone have an idea why the app works one time and 99% of the time, not? I have checked that my web browser allows redirects and javascript.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source