I have a site written by Rails3. My post model has a text column naming "content".
In the post panel, html form sets up "content" column to textarea field with tinymce.
In front page, because of using tinymce, the post.html.erb code needs to implement with raw method like <%= raw @post.content %>.
Okay, now if I close browser javascript, this textarea can type without tinymce, and maybe user will input any xss like <script>alert('xss');</script>. My front will show that alert box.
I try to sanitize(@post.content) in posts_controller, but sanitize method will filter tinymce style with each other. For example, <span style='color:red;'>foo</span> will become <span>foo</span>.
My question is: How to filter xss input and reserve tinymce style at the same time?