Skip to content
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

support Rails 7.1 render ActionView::OutputBuffer as well as String. #783

Open
KeithP opened this issue Nov 6, 2023 · 0 comments
Open

Comments

@KeithP
Copy link

KeithP commented Nov 6, 2023

After upgrading a Rails app from 7.08 to 7.11 a custom template handler for markdown files throws this error:

ActionView::Template::Error: wrong argument type ActionView::OutputBuffer (expected String)

This is because the custom template handler uses the compiled output from ActionView::Template::Handlers::ERB. It used to be String but is now ActionView::OutputBuffer type in Rails 7.1 (rails/rails@ee68644)

There is a workaround, to convert to String first: https://gist.github.com/KeithP/5f959ca70f0b09a1ce5b5cf4831829f6. But there appears to be quite a performance cost seen when running the tests.

Perhaps if redcarpet can be made to accept the buffer type directly then it might make this use case go faster or at least remove a bump when upgrading Rails :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant