Save data from a WYSIWYG editor to the database

Asked

Viewed 236 times

0

I will have a "form" inside it will have a WYSIWYG like take the typed data from inside it and save in the database, because I will have text and images inside. I am developing in Ruby, and trying to understand tinymce-Rails, I am new in the area of Ruby development. Is this the best way to use tinymce-Rails in my application? Why I want the user to be able to place images at any time, to exemplify something. EX:

TEXTO
Imagem
TEXTO

He has to be able to type a text and then load an image, and then just below continue writing. It being optional whether he put the image or not.

1 answer

0

Hello

I use Tiny and there is no mystery, I never did the test to put image inside the field, then 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 same tags and save in the database, at the time of rendering (view and index) you have to take the content and give one. html_scape so that the HTML coming from the database is rendered as html and not as text (Security issues in SQL input).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.