why does turbostream just render only the turboframe

50 views Asked by At

i don't know why it just render only the html form of the replaced turboframe but not the whole page contain that turboframe

a string ? this is my code

render turbo_stream: 
      turbo_stream.replace(
        'active_admin_btn',
        partial: 'shared/admin_btn',
        locals: {user: @user}
      )

and log

Started POST "/admin/2" for ::1 at 2024-01-16 10:03:24 +0700
Processing by UserController#active_admin as HTML
  Parameters: {"authenticity_token"=>"[FILTERED]", "id"=>"2"}
  User Load (0.3ms)  SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
  ↳ app/helpers/session_helper.rb:8:in `current_user'
  User Load (0.3ms)  SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 2], ["LIMIT", 1]]
  ↳ app/controllers/user_controller.rb:47:in `active_admin'
  TRANSACTION (0.3ms)  BEGIN
  ↳ app/controllers/user_controller.rb:48:in `active_admin'
  User Update (1.0ms)  UPDATE "users" SET "updated_at" = $1, "admin" = $2 WHERE "users"."id" = $3  [["updated_at", "2024-01-16 03:03:24.502247"], ["admin", true], ["id", 2]]
  ↳ app/controllers/user_controller.rb:48:in `active_admin'
  TRANSACTION (0.6ms)  COMMIT
  ↳ app/controllers/user_controller.rb:48:in `active_admin'
  Rendered shared/_admin_btn.html.erb (Duration: 0.8ms | Allocations: 441)
Completed 200 OK in 20ms (Views: 0.1ms | ActiveRecord: 2.5ms | Allocations: 3905)

and the view

<turbo-frame id="active_admin_btn">
                <%= render "shared/admin_btn", user: user %>
                </turbo-frame>

application.js

import { Application } from "@hotwired/stimulus"

const application = Application.start()

// Configure Stimulus development experience
application.debug = false
window.Stimulus   = application

export { application }

any help, please i have tried all the alternative way on ybt

0

There are 0 answers