You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to use this gem with the rails_admin gem and hit a problem. When a file is modified and hotwire-spark makes a request to the server to get the new content it uses the fetch function in JavaScript. When Rails receives the request the Accept header is set to */*. This causes rails_admin to render the page as JSON due to the order of how the formats are specified in respond_to [1].
I'm arguing that this is wrong (or at least unexpected) behavior. But rails_admin works when used normally in a web browser, because the web browser always sets an explicit Accept header to text/html. So I'm also arguing that hotwire-spark should behave as close as possible to the actual web browser when making requests and therefore should set an explicit Accept header.
I tried to use this gem with the rails_admin gem and hit a problem. When a file is modified and hotwire-spark makes a request to the server to get the new content it uses the
fetch
function in JavaScript. When Rails receives the request theAccept
header is set to*/*
. This causes rails_admin to render the page as JSON due to the order of how the formats are specified inrespond_to
[1].I'm arguing that this is wrong (or at least unexpected) behavior. But rails_admin works when used normally in a web browser, because the web browser always sets an explicit
Accept
header totext/html
. So I'm also arguing that hotwire-spark should behave as close as possible to the actual web browser when making requests and therefore should set an explicitAccept
header.[1] railsadminteam/rails_admin#3705
The text was updated successfully, but these errors were encountered: