Closed ArnaudRemi closed 4 years ago
Sorry for a long overdue response, but did you ever figure this out?
I see the same thing. I tried with version 4.0.1
and 3.4
. My app is using Rails 5.2
. I tried various configurations, and even removing the versioncake config entirely. The result is the same for all routes. Response bodies are always empty.
The headers come through fine. If I set a config.response_strategy
I see the expected value in the respond headers.
I tried updating jbuilder
to latest. No change.
I see this problem as well. In my case I'm using a Rails 6.0.3 "api" project, also with jbuilder.
Unfortunately I don't know enough about the Rails view rendering code to be able to debug effectively, but at some point in the pipeline it would appear that all the rendering options are lost, and so we end up with an empty body and a mime type of :text. My best guess is that this is some interaction between the ImplicitRender and Versioncake. In debugging I can see that it is finding my jbuilder templates with versions and so on, but somewhere between finding the template and actually rendering it out, the options are lost.
Potentially some further insight here. When I remove Versioncake and trace through the rendering of the templates the code eventually arrive at '_normalize_options' method at line 99 of ActionController/metal/rendering.rb (ymmv this is for Rails 6.0.3). Ultimately without Versioncake, this calls super which brings us to '_normalize_options' of ActionView/rendering.rb where the necessary options to render the template are actually set. If I DO include Versioncake, then when _normalize_options of ActionController calls super it does not go to ActionView (I don't know why).
Hello.
I followed the easy readme but since i added the gem all my response body are rendered empty. I reversed my changes and it happens when i add the gem into my gemfile, with or without the initializer.
This is my
versioncake.rb
and this is my
routes.rb