-
|
I would expect the following to work: div(class: "article-content", data_controller: "highlight") do
render @article.content
endInstead, I get the following: I think the lookup should be If I add the view that is missing or change to force a specific view, I get the following error: render partial: "action_text/contents/content", locals: { content: @article.content }This is super to fix because I can not completely eliminate ERB. |
Beta Was this translation helpful? Give feedback.
Answered by
mhenrixon
May 17, 2025
Replies: 1 comment 6 replies
-
|
An attempt that seems to work is the following: div(class: "article-content trix-content", data_controller: "highlight") do
unsafe_raw(@article.content.to_trix_html)
endI don't think this will render any attachments though, I'll have to check that. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

The trick is the following:
So the body wraps
ActionText::Contentor something which has all the data needed to render everything correctly and you just have to call.to_sat the end and it will render everything for you.Super weird rails decision if you ask me but no one questions this as long as you stick with erb html rendering.