Save data from a WYSIWYG editor to the database

0

I'm going to have a "form" inside it will have a WYSIWYG like get the data typed inside it and save it in the bank, because I'll have text and images inside. I'm developing in Ruby, and trying to understand tinymce-rails, I'm new to Ruby development. Is this the best way, to use tinymce-rails in my application? Because I want the user to be able to put images at any time, to exemplify something. EX:

TEXTO
Imagem
TEXTO

He has to be able to type text and then load an image, and just below continue to write. It is optional to put the image or not.

    
asked by anonymous 02.06.2017 / 19:06

1 answer

0

Hello

I use Tiny and it has no mystery, I never did the test put image inside the field, there you will need to search a little more, when you save data inside the textarea of tiny it will convert the formatting into HTML text with tags and save to the database, at the time of rendering (view and index) you have to get the content and give a .html_scape so that the HTML that comes from the database is rendered as html and not as text (Security Issues in SQL injection).

    
02.08.2017 / 15:40