Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Activeadmin - HTML in textarea

I've recently started using the Activeadmin gem for my Ruby on Rails blog. In my post model I have a title:string and body:text. How can I use HTML and css in my active admin textarea so I can divide my text into paragraphs and add styles to my body text?

Thanks in advance!

like image 579
jacobrubyonrails Avatar asked Feb 26 '26 13:02

jacobrubyonrails


1 Answers

Found the solution myself. The view accepted HTML and CSS if I just added .html_safe. For example <%= @post.body.html_safe %>. Easiest solution for now.

like image 86
jacobrubyonrails Avatar answered Feb 28 '26 07:02

jacobrubyonrails