2

I've updated a Rails '6.0.3' app to use hotwire-rails rather than turbolinks and am getting a 304 for the response with no update to the view within the turbo_frame_tag

I created a new Rails app from scratch and implemented hotwire successfully so I'm guessing the issue is with residual Javascript in my existing app.

Server request

The server request matches that of the new app so it doesn't appear to be the issue, note the 200 status code.

Started GET "/models/1/edit" for ::1 at 2021-01-18 13:33:22 +1100
Processing by ModelsController#edit as TURBO_STREAM
  Parameters: {"id"=>"1"}
  User Load (0.2ms)  SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2  [["id", 2], ["LIMIT", 1]]
  Model Load (0.1ms)  SELECT "models".* FROM "models" WHERE "models"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
  ↳ app/controllers/models_controller.rb:15:in `edit'
  Rendering models/edit.haml
  Rendered models/edit.haml (Duration: 1.1ms | Allocations: 1500)
Completed 200 OK in 4ms (Views: 1.3ms | ActiveRecord: 0.3ms | Allocations: 4244)

Browser

The browser response seems to be identical except for the status code being 304 rather than 200 and obviously no view change rendered.

enter image description here

Steps to recreate

  • Existing Rails '6.0.3' app
  • Update Gemfile to remove tubolinks and webpacker
  • trash app/javascript
  • trash node_modules/**
  • rails hotwire:install

Extra info

When I ran rails hotwire:install I get a File unchanged! The supplied flag value not found! app/assets/config/manifest.js message - I've checked the file and it's identical to the one generated in the new app.

4

0 回答 0