-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with render_to_string method of ActionController. "Could not render layout: undefined method headers
"
#529
Comments
I've opened #532 to solve this |
i have the same problem. perhaps |
hey @brunoprietog , a simple solution i found is to simply pass in an empty Request object: ac = ActionController::Base.new
ac.request = ActionDispatch::Request.new({})
ac.render_to_string(template: 'view/partial', locals: { variable: 'here' }, layout: 'application')
# => returns HTML string |
seanpdoyle
added a commit
to seanpdoyle/turbo-rails
that referenced
this issue
Apr 15, 2024
Follow-up to [hotwired#529][] Closes [hotwired#613][] Add test coverage to ensure that rendering outside of a request does not raise `nil`-related `NoMethodError`. Alongside a change to replace the `#turbo_frame_request_id` method's `&` operator with a conditional, this commit also makes a similar change to the `#turbo_native_app?` method, since it accesses the user agent in a similar way. [hotwired#529]: hotwired#529 [hotwired#613]: hotwired#613
seanpdoyle
added a commit
to seanpdoyle/turbo-rails
that referenced
this issue
Apr 16, 2024
Follow-up to [hotwired#529][] Closes [hotwired#613][] Remove the `&` operator from the `Turbo::Frames::FrameRequest` concern, since it isn't solving the original issues in the way that it intended. Instead, add documentation to the `README.md` that highlights `turbo-rails`'s compatibility with [ActionController::Renderer][]. [hotwired#529]: hotwired#529 [hotwired#613]: hotwired#613 [ActionController::Renderer]: https://api.rubyonrails.org/classes/ActionController/Renderer.html
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
GemFile
Error.
The text was updated successfully, but these errors were encountered: