ruby-on-rails-6trixactiontext

Trix using rails actiontext add pure html


I would like to use the rich text editor trix in rails6. How can I add a button to trix which adds html content?


Solution

  • To allow ActionText showing raw HTML, try this.

    <%= raw your_action_text_object.to_plain_text %>

    btw, I don't know why you want to add a button, could you explain in detail?