-
Notifications
You must be signed in to change notification settings - Fork 476
Open
hotwired/turbo-rails
#367Description
Currently if the response from turbo requests returns a redirect response whilst inside a frame, there is no way for the server side to conditionally control what turbo to do with the response, eg. force a full page refresh with target="_top"
There are use cases especailly for modal windows where upon succesful save we would want to perform a redirect back to the index page, where as 422 response would do the normal turbo frame replacement within current frame.
It would be nice to support something like this, which will allow us to control targets from serverside to frame targets by setting frame target via the http response headers.
if @record.save
response.headers["Turbo-Frame"] = "_top"
redirect_to settings_locations_url
else
render partial: 'form', status: :unprocessable_entity
end
What everyones thoughts are on this? or is there something I am missing to make this easier.
sukei, acetinick, thanosbellos, ugifractal, aroemers and 77 moresaltysealion, pfeiffer, feliperaul, chmich, laptopmutia and 12 morepfeiffer, feliperaul, chmich, Sub-Xaero, laptopmutia and 7 moremarcelokanzaki, feliperaul and maciejkorsan
Metadata
Metadata
Assignees
Labels
No labels