Search code examples
ruby-on-railshtmlformtastic

Creating a text area that accepts html as input in ruby on rails


I am new to rails.I want to create a text area that will accepts html as input and can process them as well. I dont know how to do this .I am using formtastic gem for my form.

Please help me out.

thanks in advance.


Solution

  • If you type any valid html on your text area, save, and then show the string with html_safe method, it should parse the html as usual.

    Example: "<b>Hello bold</b>".html_safe should render Hello bold on the screen.